From 363e4dbe9fe72541be079de0e187c79c4af78242 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 22 Oct 2024 17:04:26 +0000 Subject: [PATCH 1/2] feat: add new PSC instance configuration setting and output the PSC DNS name feat: add new API to execute SQL statements feat: add support for Free Trials feat: add support to schedule maintenance feat: additional field to set tags on a backup or cluster feat: add more observability options on the Instance level feat: add new API to perform a promotion or switchover on secondary instances feat: support for obtaining the public ip addresses of an instance and enabling either inbound or outbound public ip feat: add new API to list the databases in a project and location feat: add optional field to keep extra roles on a user if it already exists docs: various typo fixes, correcting the formatting, and clarifications on the request_id and validate_only fields in API requests and on the page_size when listing the database PiperOrigin-RevId: 688544999 Source-Link: https://github.com/googleapis/googleapis/commit/113ddfebbe8d4e0639eb19fe91817a13edfc0c5c Source-Link: https://github.com/googleapis/googleapis-gen/commit/14fa50edd57629ab318bb7b98a7286b46749e8df Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFsbG95ZGIvLk93bEJvdC55YW1sIiwiaCI6IjE0ZmE1MGVkZDU3NjI5YWIzMThiYjdiOThhNzI4NmI0Njc0OWU4ZGYifQ== --- .../google-cloud-alloydb/v1/.eslintignore | 7 + .../google-cloud-alloydb/v1/.eslintrc.json | 3 + .../google-cloud-alloydb/v1/.gitignore | 14 + .../google-cloud-alloydb/v1/.jsdoc.js | 55 + .../google-cloud-alloydb/v1/.mocharc.js | 33 + .../google-cloud-alloydb/v1/.prettierrc.js | 22 + .../google-cloud-alloydb/v1/README.md | 1 + .../google-cloud-alloydb/v1/package.json | 58 + .../google/cloud/alloydb/v1/data_model.proto | 62 + .../google/cloud/alloydb/v1/resources.proto | 1407 + .../google/cloud/alloydb/v1/service.proto | 1784 + .../v1/protos/protos.d.ts | 20386 ++++++ .../google-cloud-alloydb/v1/protos/protos.js | 52585 ++++++++++++++++ .../v1/protos/protos.json | 6030 ++ .../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 | 86 + .../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.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 | 77 + .../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 + ...ppet_metadata_google.cloud.alloydb.v1.json | 1795 + .../google-cloud-alloydb/v1/src/index.ts | 25 + .../v1/src/v1/alloy_d_b_admin_client.ts | 5425 ++ .../src/v1/alloy_d_b_admin_client_config.json | 208 + .../v1/src/v1/alloy_d_b_admin_proto_list.json | 5 + .../v1/src/v1/gapic_metadata.json | 387 + .../google-cloud-alloydb/v1/src/v1/index.ts | 19 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../v1/system-test/install.ts | 49 + .../v1/test/gapic_alloy_d_b_admin_v1.ts | 6737 ++ .../google-cloud-alloydb/v1/tsconfig.json | 19 + .../google-cloud-alloydb/v1/webpack.config.js | 64 + .../v1alpha/.eslintignore | 7 + .../v1alpha/.eslintrc.json | 3 + .../google-cloud-alloydb/v1alpha/.gitignore | 14 + .../google-cloud-alloydb/v1alpha/.jsdoc.js | 55 + .../google-cloud-alloydb/v1alpha/.mocharc.js | 33 + .../v1alpha/.prettierrc.js | 22 + .../google-cloud-alloydb/v1alpha/README.md | 1 + .../google-cloud-alloydb/v1alpha/package.json | 58 + .../cloud/alloydb/v1alpha/resources.proto | 1356 + .../cloud/alloydb/v1alpha/service.proto | 1641 + .../v1alpha/protos/protos.d.ts | 19263 ++++++ .../v1alpha/protos/protos.js | 49802 +++++++++++++++ .../v1alpha/protos/protos.json | 5762 ++ .../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_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 | 92 + .../alloy_d_b_admin.delete_instance.js | 88 + .../v1alpha/alloy_d_b_admin.delete_user.js | 81 + .../alloy_d_b_admin.failover_instance.js | 82 + ...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.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 | 77 + .../v1alpha/alloy_d_b_admin.list_users.js | 80 + .../alloy_d_b_admin.promote_cluster.js | 88 + .../alloy_d_b_admin.restart_instance.js | 82 + .../alloy_d_b_admin.restore_cluster.js | 102 + .../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 + ...metadata_google.cloud.alloydb.v1alpha.json | 1691 + .../google-cloud-alloydb/v1alpha/src/index.ts | 25 + .../src/v1alpha/alloy_d_b_admin_client.ts | 5218 ++ .../alloy_d_b_admin_client_config.json | 198 + .../v1alpha/alloy_d_b_admin_proto_list.json | 4 + .../v1alpha/src/v1alpha/gapic_metadata.json | 367 + .../v1alpha/src/v1alpha/index.ts | 19 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../v1alpha/system-test/install.ts | 49 + .../test/gapic_alloy_d_b_admin_v1alpha.ts | 6475 ++ .../v1alpha/tsconfig.json | 19 + .../v1alpha/webpack.config.js | 64 + .../google-cloud-alloydb/v1beta/.eslintignore | 7 + .../v1beta/.eslintrc.json | 3 + .../google-cloud-alloydb/v1beta/.gitignore | 14 + .../google-cloud-alloydb/v1beta/.jsdoc.js | 55 + .../google-cloud-alloydb/v1beta/.mocharc.js | 33 + .../v1beta/.prettierrc.js | 22 + .../google-cloud-alloydb/v1beta/README.md | 1 + .../google-cloud-alloydb/v1beta/package.json | 58 + .../cloud/alloydb/v1beta/resources.proto | 1386 + .../google/cloud/alloydb/v1beta/service.proto | 1641 + .../v1beta/protos/protos.d.ts | 19466 ++++++ .../v1beta/protos/protos.js | 50335 +++++++++++++++ .../v1beta/protos/protos.json | 5788 ++ .../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_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 | 92 + .../v1beta/alloy_d_b_admin.delete_instance.js | 88 + .../v1beta/alloy_d_b_admin.delete_user.js | 81 + .../alloy_d_b_admin.failover_instance.js | 82 + ...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.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 | 77 + .../v1beta/alloy_d_b_admin.list_users.js | 80 + .../v1beta/alloy_d_b_admin.promote_cluster.js | 88 + .../alloy_d_b_admin.restart_instance.js | 82 + .../v1beta/alloy_d_b_admin.restore_cluster.js | 102 + .../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 + ..._metadata_google.cloud.alloydb.v1beta.json | 1691 + .../google-cloud-alloydb/v1beta/src/index.ts | 25 + .../src/v1beta/alloy_d_b_admin_client.ts | 5218 ++ .../v1beta/alloy_d_b_admin_client_config.json | 198 + .../v1beta/alloy_d_b_admin_proto_list.json | 4 + .../v1beta/src/v1beta/gapic_metadata.json | 367 + .../v1beta/src/v1beta/index.ts | 19 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../v1beta/system-test/install.ts | 49 + .../test/gapic_alloy_d_b_admin_v1beta.ts | 6475 ++ .../google-cloud-alloydb/v1beta/tsconfig.json | 19 + .../v1beta/webpack.config.js | 64 + 177 files changed, 290769 insertions(+) create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/.eslintignore create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/.eslintrc.json create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/.jsdoc.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/.mocharc.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/.prettierrc.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/README.md create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/package.json create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/protos/google/cloud/alloydb/v1/data_model.proto create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/protos/google/cloud/alloydb/v1/resources.proto create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/protos/google/cloud/alloydb/v1/service.proto create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/protos/protos.d.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/protos/protos.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/protos/protos.json create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_backup.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_user.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.delete_backup.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.delete_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.delete_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.delete_user.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.execute_sql.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.failover_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_backup.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_connection_info.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_user.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.inject_fault.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_backups.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_clusters.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_databases.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_instances.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_users.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.promote_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.restart_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.restore_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.switchover_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.update_backup.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.update_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.update_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.update_user.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/src/index.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/src/v1/alloy_d_b_admin_client.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/src/v1/alloy_d_b_admin_client_config.json create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/src/v1/alloy_d_b_admin_proto_list.json create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/src/v1/index.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/system-test/install.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/test/gapic_alloy_d_b_admin_v1.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/tsconfig.json create mode 100644 owl-bot-staging/google-cloud-alloydb/v1/webpack.config.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/.eslintignore create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/.eslintrc.json create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/.gitignore create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/.jsdoc.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/.mocharc.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/.prettierrc.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/README.md create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/package.json create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/protos/google/cloud/alloydb/v1alpha/resources.proto create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/protos/google/cloud/alloydb/v1alpha/service.proto create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/protos/protos.d.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/protos/protos.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/protos/protos.json create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_backup.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_user.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_backup.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_user.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_backups.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_databases.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_instances.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_users.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_backup.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_user.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/src/index.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/alloy_d_b_admin_client.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/alloy_d_b_admin_client_config.json create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/alloy_d_b_admin_proto_list.json create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/index.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/system-test/install.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/test/gapic_alloy_d_b_admin_v1alpha.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/tsconfig.json create mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/webpack.config.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/.eslintignore create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/.eslintrc.json create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/.gitignore create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/.jsdoc.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/.mocharc.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/.prettierrc.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/README.md create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/package.json create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/protos/google/cloud/alloydb/v1beta/resources.proto create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/protos/google/cloud/alloydb/v1beta/service.proto create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/protos/protos.d.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/protos/protos.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/protos/protos.json create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_backup.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_user.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_backup.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_user.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.failover_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_backup.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_user.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_backups.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_clusters.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_databases.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_instances.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_users.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.restart_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_backup.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_cluster.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_instance.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_user.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/src/index.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/alloy_d_b_admin_client.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/alloy_d_b_admin_client_config.json create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/alloy_d_b_admin_proto_list.json create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/index.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/system-test/install.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/test/gapic_alloy_d_b_admin_v1beta.ts create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/tsconfig.json create mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/webpack.config.js diff --git a/owl-bot-staging/google-cloud-alloydb/v1/.eslintignore b/owl-bot-staging/google-cloud-alloydb/v1/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-alloydb/v1/.eslintrc.json b/owl-bot-staging/google-cloud-alloydb/v1/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-alloydb/v1/.gitignore b/owl-bot-staging/google-cloud-alloydb/v1/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/.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/v1/.jsdoc.js b/owl-bot-staging/google-cloud-alloydb/v1/.jsdoc.js new file mode 100644 index 00000000000..6c10f22a83a --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 2024 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/v1/.mocharc.js b/owl-bot-staging/google-cloud-alloydb/v1/.mocharc.js new file mode 100644 index 00000000000..13b67c34edc --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/.prettierrc.js b/owl-bot-staging/google-cloud-alloydb/v1/.prettierrc.js new file mode 100644 index 00000000000..9a8fd690982 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/README.md b/owl-bot-staging/google-cloud-alloydb/v1/README.md new file mode 100644 index 00000000000..433e5333737 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/README.md @@ -0,0 +1 @@ +Alloydb: Nodejs Client diff --git a/owl-bot-staging/google-cloud-alloydb/v1/package.json b/owl-bot-staging/google-cloud-alloydb/v1/package.json new file mode 100644 index 00000000000..7d0d731ff2e --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/package.json @@ -0,0 +1,58 @@ +{ + "name": "@google-cloud/alloydb", + "version": "0.1.0", + "description": "Alloydb client for Node.js", + "repository": "googleapis/nodejs-alloydb", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google alloydb", + "alloydb", + "alloy d b admin" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^4.3.4" + }, + "devDependencies": { + "@types/mocha": "^10.0.6", + "@types/node": "^20.12.12", + "@types/sinon": "^10.0.20", + "c8": "^9.1.0", + "gapic-tools": "^0.4.2", + "gts": "5.3.0", + "jsdoc": "^4.0.3", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "mocha": "^10.4.0", + "pack-n-play": "^2.0.3", + "sinon": "^15.2.0", + "typescript": "5.1.6" + }, + "engines": { + "node": ">=v14" + } +} diff --git a/owl-bot-staging/google-cloud-alloydb/v1/protos/google/cloud/alloydb/v1/data_model.proto b/owl-bot-staging/google-cloud-alloydb/v1/protos/google/cloud/alloydb/v1/data_model.proto new file mode 100644 index 00000000000..6529fccb8dc --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/protos/google/cloud/alloydb/v1/data_model.proto @@ -0,0 +1,62 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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/v1/protos/google/cloud/alloydb/v1/resources.proto b/owl-bot-staging/google-cloud-alloydb/v1/protos/google/cloud/alloydb/v1/resources.proto new file mode 100644 index 00000000000..424baceef22 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/protos/google/cloud/alloydb/v1/resources.proto @@ -0,0 +1,1407 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.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}" +}; + +// 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; +} + +// 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; +} + +// 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 then use default encryption scheme to + // protect the user data. + 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 then use default encryption scheme to + // protect the user data. + 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. Output + // only field. Ignored if passed into the request. + repeated google.type.DayOfWeek schedule = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The earliest restorable time that can be restored to. Output + // only field. + 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; + } + + // Preferred windows to perform maintenance. Currently limited to 1. + repeated MaintenanceWindow maintenance_windows = 1; +} + +// 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; + } + + // 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]; + } + + // 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]; + } + + // 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; + } + + // Cluster State + enum State { + // The state of the cluster is unknown. + STATE_UNSPECIFIED = 0; + + // The cluster is active and running. + READY = 1; + + // The cluster is stopped. All instances in the cluster are stopped. + // Customers can start a stopped cluster at any point and all their + // instances will come back to life with same names and IP resources. In + // this state, customer pays for storage. + // Associated backups could also be present in a stopped cluster. + 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. 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. 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 + ]; +} + +// 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; + } + + // Details of a single node in the instance. + // Nodes in an AlloyDB instance are ephemereal, they can change during + // update, failover, autohealing and resize operations. + message Node { + // The Compute Engine zone of the VM e.g. "us-central1-b". + string zone_id = 1; + + // The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". + string id = 2; + + // The private IP address of the VM e.g. "10.57.0.34". + string ip = 3; + + // 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; + } + + // 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; + } + + // 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]; + } + + // 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]; + + // 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]; + } + + // 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]; + } + + // 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; + } + + // 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 instance level. + // * They are copied from primary instance on read instance creation. + // * Read instances can set new or override existing flags that are relevant + // for reads, e.g. for enabling columnar cache on a read instance. Flags + // set on read instance may or may not be present on primary. + // + // + // 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; + + // 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 + ]; +} + +// 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 + 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]; + + // 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 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 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; +} + +// 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. 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]; + + // Optional. Collation for the database. + // Name of the custom or native collation for postgres. + // Example values include "C", "POSIX", etc + string collation = 3 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-alloydb/v1/protos/google/cloud/alloydb/v1/service.proto b/owl-bot-staging/google-cloud-alloydb/v1/protos/google/cloud/alloydb/v1/service.proto new file mode 100644 index 00000000000..ab73dc5ccde --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/protos/google/cloud/alloydb/v1/service.proto @@ -0,0 +1,1784 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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" + }; + } + + // 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]; +} + +// 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. +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]; +} + +// 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; +} + +// 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 + // ceritificate 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. 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 [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 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 requesting list of Databases. +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 response to listing Databases. +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/v1/protos/protos.d.ts b/owl-bot-staging/google-cloud-alloydb/v1/protos/protos.d.ts new file mode 100644 index 00000000000..ade429a820a --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/protos/protos.d.ts @@ -0,0 +1,20386 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 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); + + /** SqlResultValue _value. */ + public _value?: "value"; + + /** SqlResultValue _nullValue. */ + public _nullValue?: "nullValue"; + + /** + * 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; + } + + /** 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 + } + + /** 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"); + + /** AutomatedBackupPolicy _enabled. */ + public _enabled?: "enabled"; + + /** + * 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); + + /** ContinuousBackupConfig _enabled. */ + public _enabled?: "enabled"; + + /** + * 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); + } + + /** 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[]; + + /** + * 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 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 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); + } + + /** 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 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 source. */ + public source?: ("backupSource"|"migrationSource"); + + /** + * 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); + } + + /** 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; + + /** + * 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; + } + + /** 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 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); + } + + /** 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 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[]; + + /** + * 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); + } + + /** 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; + + /** + * 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); + + /** QueryInsightsInstanceConfig _recordApplicationTags. */ + public _recordApplicationTags?: "recordApplicationTags"; + + /** QueryInsightsInstanceConfig _recordClientAddress. */ + public _recordClientAddress?: "recordClientAddress"; + + /** QueryInsightsInstanceConfig _queryPlansPerMinute. */ + public _queryPlansPerMinute?: "queryPlansPerMinute"; + + /** + * 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 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 PscInstanceConfig. */ + interface IPscInstanceConfig { + + /** PscInstanceConfig serviceAttachmentLink */ + serviceAttachmentLink?: (string|null); + + /** PscInstanceConfig allowedConsumerProjects */ + allowedConsumerProjects?: (string[]|null); + + /** PscInstanceConfig pscDnsName */ + pscDnsName?: (string|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; + + /** + * 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); + } + + /** 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; + + /** + * 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; + } + } + + /** 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 + } + } + + /** 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 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 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 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); + } + + /** 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 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 restrictions. */ + public restrictions?: ("stringRestrictions"|"integerRestrictions"); + + /** + * 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 + } + } + + /** 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); + } + + /** 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; + + /** + * 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 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|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 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); + } + + /** 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 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); + } + + /** 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; + + /** + * 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 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 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"; + + /** + * 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 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; + } + } + } + } + + /** 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 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 + } + } + + /** 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 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 + } + } + + /** 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.fieldInfo */ + ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|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|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|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|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|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|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|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 { + + /** 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/v1/protos/protos.js b/owl-bot-staging/google-cloud-alloydb/v1/protos/protos.js new file mode 100644 index 00000000000..4379614337e --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/protos/protos.js @@ -0,0 +1,52585 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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; + + /** + * SqlResultValue _value. + * @member {"value"|undefined} _value + * @memberof google.cloud.alloydb.v1.SqlResultValue + * @instance + */ + Object.defineProperty(SqlResultValue.prototype, "_value", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SqlResultValue _nullValue. + * @member {"nullValue"|undefined} _nullValue + * @memberof google.cloud.alloydb.v1.SqlResultValue + * @instance + */ + 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) { + 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(); + 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; + })(); + + /** + * 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 + */ + 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; + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) + }); + + /** + * AutomatedBackupPolicy _enabled. + * @member {"enabled"|undefined} _enabled + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @instance + */ + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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; + + /** + * ContinuousBackupConfig _enabled. + * @member {"enabled"|undefined} _enabled + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig + * @instance + */ + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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(); + 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) { + 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(); + 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; + } + 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; + } + } + 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]); + } + } + 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 = []; + 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); + } + 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) { + 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(); + 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; + })(); + + 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) { + 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(); + 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 {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 + */ + + /** + * 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 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; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Cluster source. + * @member {"backupSource"|"migrationSource"|undefined} source + * @memberof google.cloud.alloydb.v1.Cluster + * @instance + */ + Object.defineProperty(Cluster.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["backupSource", "migrationSource"]), + 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(); + 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) { + 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(); + 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 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; + } + 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.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: + 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"; + } + 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.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; + } + 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]]); + } + 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; + } + 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]]; + } + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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; + + /** + * 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); + 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.pscEnabled = reader.bool(); + 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"; + 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); + 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 (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) + object.pscEnabled = message.pscEnabled; + 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) { + 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(); + 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; + })(); + + /** + * 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.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 + */ + + /** + * 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 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; + + /** + * 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.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]); + 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) { + 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(); + 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 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; + } + 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.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"; + } + 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.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]); + } + 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.publicIpAddress = ""; + object.pscInstanceConfig = null; + object.networkConfig = 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.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]; + } + 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 + */ + + /** + * 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; + + /** + * 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); + 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.cpuCount = reader.int32(); + 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"; + 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; + 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; + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + object.cpuCount = message.cpuCount; + 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) { + 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(); + 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; + + /** + * QueryInsightsInstanceConfig _recordApplicationTags. + * @member {"recordApplicationTags"|undefined} _recordApplicationTags + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @instance + */ + Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordApplicationTags", { + get: $util.oneOfGetter($oneOfFields = ["recordApplicationTags"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * QueryInsightsInstanceConfig _recordClientAddress. + * @member {"recordClientAddress"|undefined} _recordClientAddress + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @instance + */ + Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordClientAddress", { + get: $util.oneOfGetter($oneOfFields = ["recordClientAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * QueryInsightsInstanceConfig _queryPlansPerMinute. + * @member {"queryPlansPerMinute"|undefined} _queryPlansPerMinute + * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig + * @instance + */ + 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) { + 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(); + 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.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) { + 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(); + 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) { + 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(); + 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.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 + */ + + /** + * 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 = []; + if (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 = ""; + + /** + * 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); + 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) { + 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(); + 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; + } + 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"; + 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); + 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 = []; + 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; + 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 + */ + + /** + * 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; + + /** + * 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); + 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) { + 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(); + 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; + } + 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"; + 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); + 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; + } + 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; + 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) { + 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(); + 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; + })(); + + /** + * 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; + })(); + + 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) { + 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(); + 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 {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 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(); + 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) { + 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(); + 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 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.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: + 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.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; + } + 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; + } + 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]]; + } + 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) { + 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(); + 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} [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 + */ + + /** + * 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 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; + + // 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) + }); + + /** + * 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(); + 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) { + 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(); + 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 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; + } + 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.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: + break; + } + } + if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) + if (typeof message.requiresDbRestart !== "boolean") + return "requiresDbRestart: boolean expected"; + 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.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; + } + } + if (object.requiresDbRestart != null) + message.requiresDbRestart = Boolean(object.requiresDbRestart); + 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; + } + 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"; + } + 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) { + 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(); + 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) { + 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(); + 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; + })(); + + 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) { + 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(); + 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 + */ + + /** + * 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 = ""; + + /** + * 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); + 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.charset = reader.string(); + break; + } + case 3: { + message.collation = reader.string(); + 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"; + 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"; + 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); + 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 = ""; + } + 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; + 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|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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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.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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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 = ""; + + // 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); + 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) { + 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(); + 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; + } + 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"; + 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); + 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 = ""; + } + 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"; + } + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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 = ""; + + /** + * 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); + 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.parent = 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 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"; + 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); + 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 = ""; + } + 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; + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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.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 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"|undefined} requestSpecific + * @memberof google.cloud.alloydb.v1.OperationMetadata + * @instance + */ + Object.defineProperty(OperationMetadata.prototype, "requestSpecific", { + get: $util.oneOfGetter($oneOfFields = ["batchCreateInstancesMetadata"]), + 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(); + 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) { + 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(); + switch (tag >>> 3) { + case 8: { + message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.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.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.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"; + } + 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.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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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; + })(); + + return v1; + })(); + + 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.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) { + 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(); + 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; + })(); + + 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) { + 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(); + 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) { + 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(); + 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.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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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; + })(); + + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * 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.fieldInfo. + * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldInfo"] = null; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = 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) { + 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(); + 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 291403980: { + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.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.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; + } + 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; + } + 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.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"]); + } + 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"]); + } + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 = {}; + + /** + * 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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/v1/protos/protos.json b/owl-bot-staging/google-cloud-alloydb/v1/protos/protos.json new file mode 100644 index 00000000000..a7ebf57f6ce --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/protos/protos.json @@ -0,0 +1,6030 @@ +{ + "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": "ServiceProto", + "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/Network", + "(google.api.resource_definition).pattern": "projects/{project}/global/networks/{network}" + }, + "nested": { + "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 + } + } + } + }, + "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 + } + }, + "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 + } + } + }, + "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 + } + }, + "nested": { + "MaintenanceWindow": { + "fields": { + "day": { + "type": "google.type.DayOfWeek", + "id": 1 + }, + "startTime": { + "type": "google.type.TimeOfDay", + "id": 2 + } + } + } + } + }, + "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" + ] + } + }, + "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" + } + }, + "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" + } + } + }, + "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 + } + } + }, + "PrimaryConfig": { + "fields": { + "secondaryClusterNames": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "PscConfig": { + "fields": { + "pscEnabled": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "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 + } + } + }, + "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 + }, + "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" + } + } + }, + "nested": { + "MachineConfig": { + "fields": { + "cpuCount": { + "type": "int32", + "id": 1 + } + } + }, + "Node": { + "fields": { + "zoneId": { + "type": "string", + "id": 1 + }, + "id": { + "type": "string", + "id": 2 + }, + "ip": { + "type": "string", + "id": 3 + }, + "state": { + "type": "string", + "id": 4 + } + } + }, + "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 + } + } + } + }, + "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" + } + } + } + }, + "PscInstanceConfig": { + "fields": { + "serviceAttachmentLink": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "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" + } + } + } + }, + "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" + } + } + }, + "nested": { + "AuthorizedNetwork": { + "fields": { + "cidrRange": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_info).format": "IPV4" + } + } + } + } + } + }, + "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 + } + } + } + }, + "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" + } + }, + "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" + ] + } + }, + "fields": { + "stringRestrictions": { + "type": "StringRestrictions", + "id": 7 + }, + "integerRestrictions": { + "type": "IntegerRestrictions", + "id": 8 + }, + "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 + } + }, + "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 + } + } + } + }, + "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" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "charset": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "collation": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "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" + } + } + ] + }, + "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" + } + } + } + }, + "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" + } + } + } + }, + "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 + } + } + }, + "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" + ] + } + }, + "fields": { + "batchCreateInstancesMetadata": { + "type": "BatchCreateInstancesMetadata", + "id": 8, + "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" + } + } + } + }, + "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 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api;api", + "java_multiple_files": true, + "java_outer_classname": "LaunchStageProto", + "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 + } + }, + "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 + } + } + } + }, + "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 + } + } + }, + "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 + } + } + } + }, + "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": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "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": { + "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, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "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": { + "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": { + "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": { + "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": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "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": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "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": { + "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": { + "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": { + "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, + "options": { + "packed": false + } + }, + "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": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "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": { + "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": { + "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": { + "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": { + "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": { + "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": { + "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": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "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": { + "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", + "cc_enable_arenas": true + }, + "nested": { + "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/v1/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js new file mode 100644 index 00000000000..f4a949af133 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js @@ -0,0 +1,81 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.create_backup.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_backup.js new file mode 100644 index 00000000000..55f5bf8f3d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_backup.js @@ -0,0 +1,91 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.create_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_cluster.js new file mode 100644 index 00000000000..a476e312f50 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_cluster.js @@ -0,0 +1,93 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.create_instance.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_instance.js new file mode 100644 index 00000000000..a933aa9f7a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_instance.js @@ -0,0 +1,93 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js new file mode 100644 index 00000000000..1163cebc496 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js @@ -0,0 +1,93 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js new file mode 100644 index 00000000000..b0f338a53f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js @@ -0,0 +1,93 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.create_user.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_user.js new file mode 100644 index 00000000000..d94d20fcb14 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_user.js @@ -0,0 +1,90 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.delete_backup.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.delete_backup.js new file mode 100644 index 00000000000..30f51c39f28 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.delete_backup.js @@ -0,0 +1,88 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.delete_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.delete_cluster.js new file mode 100644 index 00000000000..9d937d84ba9 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.delete_cluster.js @@ -0,0 +1,93 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.delete_instance.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.delete_instance.js new file mode 100644 index 00000000000..811f1d0db5c --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.delete_instance.js @@ -0,0 +1,89 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.delete_user.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.delete_user.js new file mode 100644 index 00000000000..fe6477101ce --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.delete_user.js @@ -0,0 +1,81 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.execute_sql.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.execute_sql.js new file mode 100644 index 00000000000..0e8e5f5ad59 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.execute_sql.js @@ -0,0 +1,86 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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_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' + + // 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, + user, + 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/v1/samples/generated/v1/alloy_d_b_admin.failover_instance.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.failover_instance.js new file mode 100644 index 00000000000..bbfdd104ce8 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.failover_instance.js @@ -0,0 +1,83 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js new file mode 100644 index 00000000000..3735a0ddac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js @@ -0,0 +1,94 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 + * ceritificate 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/v1/samples/generated/v1/alloy_d_b_admin.get_backup.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_backup.js new file mode 100644 index 00000000000..a874b5e039c --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_backup.js @@ -0,0 +1,61 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.get_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_cluster.js new file mode 100644 index 00000000000..c26fff87612 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_cluster.js @@ -0,0 +1,67 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.get_connection_info.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_connection_info.js new file mode 100644 index 00000000000..e56f7efbcaf --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_connection_info.js @@ -0,0 +1,76 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.get_instance.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_instance.js new file mode 100644 index 00000000000..6167195ca0a --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_instance.js @@ -0,0 +1,66 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.get_user.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_user.js new file mode 100644 index 00000000000..33a8eb2d3a4 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_user.js @@ -0,0 +1,62 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.inject_fault.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.inject_fault.js new file mode 100644 index 00000000000..78f96ef28e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.inject_fault.js @@ -0,0 +1,88 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.list_backups.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_backups.js new file mode 100644 index 00000000000..4d8ac6bd6d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_backups.js @@ -0,0 +1,80 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.list_clusters.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_clusters.js new file mode 100644 index 00000000000..f887660681c --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_clusters.js @@ -0,0 +1,83 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.list_databases.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_databases.js new file mode 100644 index 00000000000..15923a41ddd --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_databases.js @@ -0,0 +1,81 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.list_instances.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_instances.js new file mode 100644 index 00000000000..120678beb7a --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_instances.js @@ -0,0 +1,85 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js new file mode 100644 index 00000000000..18b1912620d --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js @@ -0,0 +1,77 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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' + + // 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/v1/samples/generated/v1/alloy_d_b_admin.list_users.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_users.js new file mode 100644 index 00000000000..c2b9c8db326 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_users.js @@ -0,0 +1,80 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.promote_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.promote_cluster.js new file mode 100644 index 00000000000..046405d4bae --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.promote_cluster.js @@ -0,0 +1,89 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.restart_instance.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.restart_instance.js new file mode 100644 index 00000000000..2f5362f1a15 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.restart_instance.js @@ -0,0 +1,88 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.restore_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.restore_cluster.js new file mode 100644 index 00000000000..d5afe06e848 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.restore_cluster.js @@ -0,0 +1,102 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.switchover_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.switchover_cluster.js new file mode 100644 index 00000000000..08d32694588 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.switchover_cluster.js @@ -0,0 +1,83 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.update_backup.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.update_backup.js new file mode 100644 index 00000000000..ab87adf08c1 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.update_backup.js @@ -0,0 +1,94 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.update_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.update_cluster.js new file mode 100644 index 00000000000..b46d35b2a42 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.update_cluster.js @@ -0,0 +1,95 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.update_instance.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.update_instance.js new file mode 100644 index 00000000000..c1d663630f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.update_instance.js @@ -0,0 +1,95 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/alloy_d_b_admin.update_user.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.update_user.js new file mode 100644 index 00000000000..7ffa0bed716 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.update_user.js @@ -0,0 +1,92 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json new file mode 100644 index 00000000000..f24834e655b --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json @@ -0,0 +1,1795 @@ +{ + "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_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": 78, + "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" + } + ], + "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": 69, + "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" + } + ], + "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" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-alloydb/v1/src/index.ts b/owl-bot-staging/google-cloud-alloydb/v1/src/index.ts new file mode 100644 index 00000000000..0d58c12b9be --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 v1 from './v1'; +const AlloyDBAdminClient = v1.AlloyDBAdminClient; +type AlloyDBAdminClient = v1.AlloyDBAdminClient; +export {v1, AlloyDBAdminClient}; +export default {v1, AlloyDBAdminClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/google-cloud-alloydb/v1/src/v1/alloy_d_b_admin_client.ts b/owl-bot-staging/google-cloud-alloydb/v1/src/v1/alloy_d_b_admin_client.ts new file mode 100644 index 00000000000..1acce893594 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/src/v1/alloy_d_b_admin_client.ts @@ -0,0 +1,5425 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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'); + +/** + * 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; + 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://developers.google.com/identity/protocols/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.protobuf.Root.fromJSON(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 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)), + 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', '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(); + return this.innerApiCalls.getCluster(request, options, callback); + } +/** + * 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(); + return this.innerApiCalls.getInstance(request, options, callback); + } +/** + * 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 {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(); + return this.innerApiCalls.executeSql(request, options, callback); + } +/** + * 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(); + return this.innerApiCalls.getBackup(request, options, callback); + } +/** + * 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 + * ceritificate 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(); + return this.innerApiCalls.generateClientCertificate(request, options, callback); + } +/** + * 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(); + return this.innerApiCalls.getConnectionInfo(request, options, callback); + } +/** + * 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(); + return this.innerApiCalls.getUser(request, options, callback); + } +/** + * 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(); + return this.innerApiCalls.createUser(request, options, callback); + } +/** + * 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(); + return this.innerApiCalls.updateUser(request, options, callback); + } +/** + * 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(); + return this.innerApiCalls.deleteUser(request, options, callback); + } + +/** + * 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(); + return this.innerApiCalls.createCluster(request, options, callback); + } +/** + * 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>{ + 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(); + return this.innerApiCalls.updateCluster(request, options, callback); + } +/** + * 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>{ + 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; + } +/** + * 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(); + return this.innerApiCalls.deleteCluster(request, options, callback); + } +/** + * 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>{ + 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(); + return this.innerApiCalls.promoteCluster(request, options, callback); + } +/** + * 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>{ + 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(); + return this.innerApiCalls.switchoverCluster(request, options, callback); + } +/** + * 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>{ + 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(); + return this.innerApiCalls.restoreCluster(request, options, callback); + } +/** + * 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>{ + 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(); + return this.innerApiCalls.createSecondaryCluster(request, options, callback); + } +/** + * 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>{ + 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(); + return this.innerApiCalls.createInstance(request, options, callback); + } +/** + * 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>{ + 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(); + return this.innerApiCalls.createSecondaryInstance(request, options, callback); + } +/** + * 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>{ + 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(); + return this.innerApiCalls.batchCreateInstances(request, options, callback); + } +/** + * 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>{ + 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(); + return this.innerApiCalls.updateInstance(request, options, callback); + } +/** + * 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>{ + 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(); + return this.innerApiCalls.deleteInstance(request, options, callback); + } +/** + * 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>{ + 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(); + return this.innerApiCalls.failoverInstance(request, options, callback); + } +/** + * 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>{ + 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(); + return this.innerApiCalls.injectFault(request, options, callback); + } +/** + * 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>{ + 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(); + return this.innerApiCalls.restartInstance(request, options, callback); + } +/** + * 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>{ + 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(); + return this.innerApiCalls.createBackup(request, options, callback); + } +/** + * 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>{ + 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(); + return this.innerApiCalls.updateBackup(request, options, callback); + } +/** + * 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>{ + 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(); + return this.innerApiCalls.deleteBackup(request, options, callback); + } +/** + * 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>{ + 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(); + return this.innerApiCalls.listClusters(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, 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(); + 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(); + 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(); + return this.innerApiCalls.listInstances(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, 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(); + 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(); + 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(); + return this.innerApiCalls.listBackups(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, 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(); + 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(); + 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 {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(); + return this.innerApiCalls.listSupportedDatabaseFlags(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, 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 {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(); + 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 {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(); + 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(); + return this.innerApiCalls.listUsers(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, 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(); + 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(); + 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(); + return this.innerApiCalls.listDatabases(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, 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(); + 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(); + 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, + options?: + | 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]> { + 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 { + 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, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + 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, + options?: + | 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 { + 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._terminated = true; + stub.close(); + this.iamClient.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-alloydb/v1/src/v1/alloy_d_b_admin_client_config.json b/owl-bot-staging/google-cloud-alloydb/v1/src/v1/alloy_d_b_admin_client_config.json new file mode 100644 index 00000000000..a802cb3de79 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/src/v1/alloy_d_b_admin_client_config.json @@ -0,0 +1,208 @@ +{ + "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" + }, + "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/v1/src/v1/alloy_d_b_admin_proto_list.json b/owl-bot-staging/google-cloud-alloydb/v1/src/v1/alloy_d_b_admin_proto_list.json new file mode 100644 index 00000000000..b5e2e53d68c --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/src/v1/alloy_d_b_admin_proto_list.json @@ -0,0 +1,5 @@ +[ + "../../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/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-alloydb/v1/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..137fb3217d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/src/v1/gapic_metadata.json @@ -0,0 +1,387 @@ +{ + "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" + ] + }, + "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" + ] + }, + "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" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-alloydb/v1/src/v1/index.ts b/owl-bot-staging/google-cloud-alloydb/v1/src/v1/index.ts new file mode 100644 index 00000000000..93eec87dc06 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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'; diff --git a/owl-bot-staging/google-cloud-alloydb/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-alloydb/v1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..f26aa8e2c06 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-alloydb/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-alloydb/v1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..bd7a760f403 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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} from '@google-cloud/alloydb'; + +// check that the client class type name can be used +function doStuffWithAlloyDBAdminClient(client: AlloyDBAdminClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const alloyDBAdminClient = new AlloyDBAdminClient(); + doStuffWithAlloyDBAdminClient(alloyDBAdminClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-alloydb/v1/system-test/install.ts b/owl-bot-staging/google-cloud-alloydb/v1/system-test/install.ts new file mode 100644 index 00000000000..fd5bfdc71d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1/test/gapic_alloy_d_b_admin_v1.ts b/owl-bot-staging/google-cloud-alloydb/v1/test/gapic_alloy_d_b_admin_v1.ts new file mode 100644 index 00000000000..f5f20bad202 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/test/gapic_alloy_d_b_admin_v1.ts @@ -0,0 +1,6737 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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(); + assert(client.alloyDBAdminStub); + client.close().then(() => { + done(); + }); + }); + + 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(); + }); + }); + + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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('deleteCluster', () => { + it('invokes deleteCluster without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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); + } + }); + }); + 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', + }); + 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', + }); + 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', + }); + 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); + } + }); + }); + 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', + }); + 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', + }); + 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', + }); + 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); + } + }); + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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); + } + }); + }); + 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', + }); + 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); + } + }); + }); + 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', + }); + 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); + } + }); + }); + 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.ListOperationsResponse[] = []; + 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', + }); + 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.ListOperationsResponse[] = []; + 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', () => { + 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', + }); + 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', () => { + 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', + }); + 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', () => { + 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', + }); + 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', () => { + 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', + }); + 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', () => { + 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', + }); + 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', () => { + 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', + }); + 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', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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', () => { + 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', + }); + 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', () => { + 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', + }); + 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/v1/tsconfig.json b/owl-bot-staging/google-cloud-alloydb/v1/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/google-cloud-alloydb/v1/webpack.config.js b/owl-bot-staging/google-cloud-alloydb/v1/webpack.config.js new file mode 100644 index 00000000000..ee88fe6afc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1/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', +}; diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/.eslintignore b/owl-bot-staging/google-cloud-alloydb/v1alpha/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/.eslintrc.json b/owl-bot-staging/google-cloud-alloydb/v1alpha/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/.gitignore b/owl-bot-staging/google-cloud-alloydb/v1alpha/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/.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/v1alpha/.jsdoc.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/.jsdoc.js new file mode 100644 index 00000000000..6c10f22a83a --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 2024 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/v1alpha/.mocharc.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/.mocharc.js new file mode 100644 index 00000000000..13b67c34edc --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1alpha/.prettierrc.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/.prettierrc.js new file mode 100644 index 00000000000..9a8fd690982 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1alpha/README.md b/owl-bot-staging/google-cloud-alloydb/v1alpha/README.md new file mode 100644 index 00000000000..433e5333737 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/README.md @@ -0,0 +1 @@ +Alloydb: Nodejs Client diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/package.json b/owl-bot-staging/google-cloud-alloydb/v1alpha/package.json new file mode 100644 index 00000000000..7d0d731ff2e --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/package.json @@ -0,0 +1,58 @@ +{ + "name": "@google-cloud/alloydb", + "version": "0.1.0", + "description": "Alloydb client for Node.js", + "repository": "googleapis/nodejs-alloydb", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google alloydb", + "alloydb", + "alloy d b admin" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^4.3.4" + }, + "devDependencies": { + "@types/mocha": "^10.0.6", + "@types/node": "^20.12.12", + "@types/sinon": "^10.0.20", + "c8": "^9.1.0", + "gapic-tools": "^0.4.2", + "gts": "5.3.0", + "jsdoc": "^4.0.3", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "mocha": "^10.4.0", + "pack-n-play": "^2.0.3", + "sinon": "^15.2.0", + "typescript": "5.1.6" + }, + "engines": { + "node": ">=v14" + } +} diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/protos/google/cloud/alloydb/v1alpha/resources.proto b/owl-bot-staging/google-cloud-alloydb/v1alpha/protos/google/cloud/alloydb/v1alpha/resources.proto new file mode 100644 index 00000000000..0067e0e9a3c --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/protos/google/cloud/alloydb/v1alpha/resources.proto @@ -0,0 +1,1356 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.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}" +}; + +// 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 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; +} + +// 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 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, e.g. via + // 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 then use default encryption scheme to + // protect the user data. + 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 then use default encryption scheme to + // protect the user data. + 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. Output + // only field. Ignored if passed into the request. + repeated google.type.DayOfWeek schedule = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The earliest restorable time that can be restored to. Output + // only field. + 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]; +} + +// 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}" + 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; + } + + // 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]; + } + + // 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]; + } + + // Cluster State + enum State { + // The state of the cluster is unknown. + STATE_UNSPECIFIED = 0; + + // The cluster is active and running. + READY = 1; + + // The cluster is stopped. All instances in the cluster are stopped. + // Customers can start a stopped cluster at any point and all their + // instances will come back to life with same names and IP resources. In + // this state, customer pays for storage. + // Associated backups could also be present in a stopped cluster. + 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. 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]; +} + +// 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}" + 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; + } + + // Details of a single node in the instance. + // Nodes in an AlloyDB instance are ephemereal, they can change during + // update, failover, autohealing and resize operations. + message Node { + // The Compute Engine zone of the VM e.g. "us-central1-b". + string zone_id = 1; + + // The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". + string id = 2; + + // The private IP address of the VM e.g. "10.57.0.34". + string ip = 3; + + // 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; + } + + // 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; + } + + // 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 config option for this instance. + SslConfig ssl_config = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration for setting up a PSC interface. This information needs to be + // provided by the customer. + // PSC interfaces will be created and added to VMs via SLM (adding a network + // interface will require recreating the VM). For HA instances this will be + // done via LDTM. + message PscInterfaceConfig { + // A list of endpoints in the consumer VPC the interface might initiate + // outbound connections to. This list has to be provided when the PSC + // interface is created. + repeated string consumer_endpoint_ips = 1; + + // The NetworkAttachment resource created in the consumer VPC to which the + // PSC interface will be linked, in the form of: + // "projects/${CONSUMER_PROJECT}/regions/${REGION}/networkAttachments/${NETWORK_ATTACHMENT_NAME}". + // NetworkAttachment has to be provided when the PSC interface is created. + string network_attachment = 2; + } + + // 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]; + + // 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]; + + // Optional. List of consumer networks that are allowed to create + // PSC endpoints to service-attachments to this instance. + repeated string allowed_consumer_networks = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // 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. All the VMs created for the primary + // instance will share the same configurations. Currently we only support 0 + // or 1 PSC interface. + repeated PscInterfaceConfig psc_interface_configs = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of service attachments that this instance has created + // endpoints to connect with. Currently, only a single outgoing service + // attachment is supported per instance. + repeated string outgoing_service_attachment_links = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether PSC connectivity is enabled for this instance. + // This is populated by referencing the value from the parent cluster. + bool psc_enabled = 6 [(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]; + } + + // 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; + } + + // 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 instance level. + // * They are copied from primary instance on read instance creation. + // * Read instances can set new or override existing flags that are relevant + // for reads, e.g. for enabling columnar cache on a read instance. Flags + // set on read instance may or may not be present on primary. + // + // + // 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; + + // 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_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]; +} + +// 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" + }; + + // 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}" + 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 + 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]; + + // 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]; +} + +// 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}" + }; + + // 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 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 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; +} + +// Message describing User object. +message User { + option (google.api.resource) = { + type: "alloydb.googleapis.com/User" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/users/{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]; +} + +// 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. 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]; + + // Optional. Collation for the database. + // Name of the custom or native collation for postgres. + // Example values include "C", "POSIX", etc + string collation = 3 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/protos/google/cloud/alloydb/v1alpha/service.proto b/owl-bot-staging/google-cloud-alloydb/v1alpha/protos/google/cloud/alloydb/v1alpha/service.proto new file mode 100644 index 00000000000..2b558324f83 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/protos/google/cloud/alloydb/v1alpha/service.proto @@ -0,0 +1,1641 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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/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" + }; + } + + // 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" + }; + } + + // 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" + }; + } + + // 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"; + } +} + +// 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating 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 (e.g. permission checks and + // any other type of validation), but do 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating 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 (e.g. permission checks and + // any other type of validation), but do 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating 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 (e.g. permission checks and + // any other type of validation), but do not actually execute the update + // 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]; +} + +// 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + 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 (e.g. permission checks and + // any other type of validation), but do not actually execute the delete. + 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 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + 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 (e.g. permission checks and + // any other type of validation), but do not actually execute the delete. + 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. +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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating 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 (e.g. permission checks and + // any other type of validation), but do not actually execute the import + // 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating 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 (e.g. permission checks and + // any other type of validation), but do 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating 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 (e.g. permission checks and + // any other type of validation), but do 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating 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 + // processsing 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating 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 (e.g. permission checks and + // any other type of validation), but do not actually execute the update + // 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + 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 (e.g. permission checks and + // any other type of validation), but do not actually execute the delete. + 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the failover. + 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the fault + // injection. + 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the restart. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + 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; +} + +// 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + 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 + // ceritificate 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + 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. 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 [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 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + 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 requesting list of Databases. +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, an appropriate number of databases + // will be returned. The max value will be 2000, 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 response to listing Databases. +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/v1alpha/protos/protos.d.ts b/owl-bot-staging/google-cloud-alloydb/v1alpha/protos/protos.d.ts new file mode 100644 index 00000000000..95045a51ef4 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/protos/protos.d.ts @@ -0,0 +1,19263 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 v1alpha. */ + namespace v1alpha { + + /** 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 + } + + /** 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"); + + /** AutomatedBackupPolicy _enabled. */ + public _enabled?: "enabled"; + + /** + * 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); + + /** ContinuousBackupConfig _enabled. */ + public _enabled?: "enabled"; + + /** + * 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 Cluster. */ + interface ICluster { + + /** Cluster backupSource */ + backupSource?: (google.cloud.alloydb.v1alpha.IBackupSource|null); + + /** Cluster migrationSource */ + migrationSource?: (google.cloud.alloydb.v1alpha.IMigrationSource|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); + } + + /** 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 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 source. */ + public source?: ("backupSource"|"migrationSource"); + + /** + * 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); + } + + /** 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; + + /** + * 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; + } + + /** 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 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); + } + + /** 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 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); + + /** + * 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); + } + + /** 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; + + /** + * 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); + + /** QueryInsightsInstanceConfig _recordApplicationTags. */ + public _recordApplicationTags?: "recordApplicationTags"; + + /** QueryInsightsInstanceConfig _recordClientAddress. */ + public _recordClientAddress?: "recordClientAddress"; + + /** QueryInsightsInstanceConfig _queryPlansPerMinute. */ + public _queryPlansPerMinute?: "queryPlansPerMinute"; + + /** + * 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 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 consumerEndpointIps */ + consumerEndpointIps?: (string[]|null); + + /** PscInterfaceConfig networkAttachment */ + networkAttachment?: (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 consumerEndpointIps. */ + public consumerEndpointIps: string[]; + + /** PscInterfaceConfig networkAttachment. */ + public networkAttachment: 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 PscInstanceConfig. */ + interface IPscInstanceConfig { + + /** PscInstanceConfig serviceAttachmentLink */ + serviceAttachmentLink?: (string|null); + + /** PscInstanceConfig allowedConsumerProjects */ + allowedConsumerProjects?: (string[]|null); + + /** PscInstanceConfig allowedConsumerNetworks */ + allowedConsumerNetworks?: (string[]|null); + + /** PscInstanceConfig pscInterfaceConfigs */ + pscInterfaceConfigs?: (google.cloud.alloydb.v1alpha.Instance.IPscInterfaceConfig[]|null); + + /** PscInstanceConfig outgoingServiceAttachmentLinks */ + outgoingServiceAttachmentLinks?: (string[]|null); + + /** PscInstanceConfig pscEnabled */ + pscEnabled?: (boolean|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 allowedConsumerNetworks. */ + public allowedConsumerNetworks: string[]; + + /** PscInstanceConfig pscInterfaceConfigs. */ + public pscInterfaceConfigs: google.cloud.alloydb.v1alpha.Instance.IPscInterfaceConfig[]; + + /** PscInstanceConfig outgoingServiceAttachmentLinks. */ + public outgoingServiceAttachmentLinks: string[]; + + /** PscInstanceConfig pscEnabled. */ + public pscEnabled: boolean; + + /** + * 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); + } + + /** 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; + + /** + * 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; + } + } + + /** 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 + } + } + + /** 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 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); + } + + /** 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 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); + + /** + * 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 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); + } + + /** 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 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 restrictions. */ + public restrictions?: ("stringRestrictions"|"integerRestrictions"); + + /** + * 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 + } + } + + /** 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); + } + + /** 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); + + /** + * 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); + } + + /** 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; + + /** + * 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; + } + + /** 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 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 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 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; + } + + 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|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|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|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; + } + + /** 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 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 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); + } + + /** 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; + + /** + * 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 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); + } + + /** 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; + + /** + * 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 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 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"; + + /** + * 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 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; + } + } + } + } + + /** 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 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 + } + } + + /** 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 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 + } + } + + /** 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.fieldInfo */ + ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|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|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|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|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|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|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|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 { + + /** 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/v1alpha/protos/protos.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/protos/protos.js new file mode 100644 index 00000000000..daaf21ff204 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/protos/protos.js @@ -0,0 +1,49802 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.v1alpha = (function() { + + /** + * Namespace v1alpha. + * @memberof google.cloud.alloydb + * @namespace + */ + var v1alpha = {}; + + /** + * 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 + */ + 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; + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) + }); + + /** + * AutomatedBackupPolicy _enabled. + * @member {"enabled"|undefined} _enabled + * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy + * @instance + */ + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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; + + /** + * ContinuousBackupConfig _enabled. + * @member {"enabled"|undefined} _enabled + * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig + * @instance + */ + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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.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 {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 + */ + + /** + * 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 = {}; + if (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 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; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Cluster source. + * @member {"backupSource"|"migrationSource"|undefined} source + * @memberof google.cloud.alloydb.v1alpha.Cluster + * @instance + */ + Object.defineProperty(Cluster.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["backupSource", "migrationSource"]), + 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.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.satisfiesPzi); + 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) { + 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(); + 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 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; + } + 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.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: + 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; + } + 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.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; + } + 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); + } + 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 = {}; + } + 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.satisfiesPzi = false; + } + 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.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + object.satisfiesPzi = message.satisfiesPzi; + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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; + + /** + * 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); + 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.pscEnabled = reader.bool(); + 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"; + 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); + 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 (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) + object.pscEnabled = message.pscEnabled; + 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; + })(); + + /** + * 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.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 + */ + + /** + * 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 = {}; + if (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 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; + + /** + * 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.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); + 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) { + 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(); + 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 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; + } + 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.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; + } + 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.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); + } + 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 = []; + 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.publicIpAddress = ""; + object.pscInstanceConfig = null; + object.networkConfig = null; + object.satisfiesPzi = false; + } + 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.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; + 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 + */ + + /** + * 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; + + /** + * 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); + 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.cpuCount = reader.int32(); + 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"; + 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; + 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; + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + object.cpuCount = message.cpuCount; + 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) { + 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(); + 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; + + /** + * QueryInsightsInstanceConfig _recordApplicationTags. + * @member {"recordApplicationTags"|undefined} _recordApplicationTags + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @instance + */ + Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordApplicationTags", { + get: $util.oneOfGetter($oneOfFields = ["recordApplicationTags"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * QueryInsightsInstanceConfig _recordClientAddress. + * @member {"recordClientAddress"|undefined} _recordClientAddress + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @instance + */ + Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordClientAddress", { + get: $util.oneOfGetter($oneOfFields = ["recordClientAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * QueryInsightsInstanceConfig _queryPlansPerMinute. + * @member {"queryPlansPerMinute"|undefined} _queryPlansPerMinute + * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig + * @instance + */ + 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) { + 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(); + 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.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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 {Array.|null} [consumerEndpointIps] PscInterfaceConfig consumerEndpointIps + * @property {string|null} [networkAttachment] PscInterfaceConfig networkAttachment + */ + + /** + * 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) { + this.consumerEndpointIps = []; + if (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 consumerEndpointIps. + * @member {Array.} consumerEndpointIps + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig + * @instance + */ + PscInterfaceConfig.prototype.consumerEndpointIps = $util.emptyArray; + + /** + * PscInterfaceConfig networkAttachment. + * @member {string} networkAttachment + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig + * @instance + */ + PscInterfaceConfig.prototype.networkAttachment = ""; + + /** + * 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.consumerEndpointIps != null && message.consumerEndpointIps.length) + for (var i = 0; i < message.consumerEndpointIps.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.consumerEndpointIps[i]); + if (message.networkAttachment != null && Object.hasOwnProperty.call(message, "networkAttachment")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.networkAttachment); + 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) { + 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(); + switch (tag >>> 3) { + case 1: { + if (!(message.consumerEndpointIps && message.consumerEndpointIps.length)) + message.consumerEndpointIps = []; + message.consumerEndpointIps.push(reader.string()); + break; + } + case 2: { + message.networkAttachment = 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.consumerEndpointIps != null && message.hasOwnProperty("consumerEndpointIps")) { + if (!Array.isArray(message.consumerEndpointIps)) + return "consumerEndpointIps: array expected"; + for (var i = 0; i < message.consumerEndpointIps.length; ++i) + if (!$util.isString(message.consumerEndpointIps[i])) + return "consumerEndpointIps: string[] expected"; + } + if (message.networkAttachment != null && message.hasOwnProperty("networkAttachment")) + if (!$util.isString(message.networkAttachment)) + return "networkAttachment: 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.consumerEndpointIps) { + if (!Array.isArray(object.consumerEndpointIps)) + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig.consumerEndpointIps: array expected"); + message.consumerEndpointIps = []; + for (var i = 0; i < object.consumerEndpointIps.length; ++i) + message.consumerEndpointIps[i] = String(object.consumerEndpointIps[i]); + } + if (object.networkAttachment != null) + message.networkAttachment = String(object.networkAttachment); + 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.arrays || options.defaults) + object.consumerEndpointIps = []; + if (options.defaults) + object.networkAttachment = ""; + if (message.consumerEndpointIps && message.consumerEndpointIps.length) { + object.consumerEndpointIps = []; + for (var j = 0; j < message.consumerEndpointIps.length; ++j) + object.consumerEndpointIps[j] = message.consumerEndpointIps[j]; + } + if (message.networkAttachment != null && message.hasOwnProperty("networkAttachment")) + object.networkAttachment = message.networkAttachment; + 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.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 {Array.|null} [allowedConsumerNetworks] PscInstanceConfig allowedConsumerNetworks + * @property {Array.|null} [pscInterfaceConfigs] PscInstanceConfig pscInterfaceConfigs + * @property {Array.|null} [outgoingServiceAttachmentLinks] PscInstanceConfig outgoingServiceAttachmentLinks + * @property {boolean|null} [pscEnabled] PscInstanceConfig pscEnabled + */ + + /** + * 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.allowedConsumerNetworks = []; + this.pscInterfaceConfigs = []; + this.outgoingServiceAttachmentLinks = []; + if (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 allowedConsumerNetworks. + * @member {Array.} allowedConsumerNetworks + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig + * @instance + */ + PscInstanceConfig.prototype.allowedConsumerNetworks = $util.emptyArray; + + /** + * PscInstanceConfig pscInterfaceConfigs. + * @member {Array.} pscInterfaceConfigs + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig + * @instance + */ + PscInstanceConfig.prototype.pscInterfaceConfigs = $util.emptyArray; + + /** + * PscInstanceConfig outgoingServiceAttachmentLinks. + * @member {Array.} outgoingServiceAttachmentLinks + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig + * @instance + */ + PscInstanceConfig.prototype.outgoingServiceAttachmentLinks = $util.emptyArray; + + /** + * PscInstanceConfig pscEnabled. + * @member {boolean} pscEnabled + * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig + * @instance + */ + PscInstanceConfig.prototype.pscEnabled = false; + + /** + * 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.allowedConsumerNetworks != null && message.allowedConsumerNetworks.length) + for (var i = 0; i < message.allowedConsumerNetworks.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.allowedConsumerNetworks[i]); + 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 4, wireType 2 =*/34).fork()).ldelim(); + if (message.outgoingServiceAttachmentLinks != null && message.outgoingServiceAttachmentLinks.length) + for (var i = 0; i < message.outgoingServiceAttachmentLinks.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.outgoingServiceAttachmentLinks[i]); + if (message.pscEnabled != null && Object.hasOwnProperty.call(message, "pscEnabled")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.pscEnabled); + 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) { + 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(); + 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 3: { + if (!(message.allowedConsumerNetworks && message.allowedConsumerNetworks.length)) + message.allowedConsumerNetworks = []; + message.allowedConsumerNetworks.push(reader.string()); + break; + } + case 4: { + if (!(message.pscInterfaceConfigs && message.pscInterfaceConfigs.length)) + message.pscInterfaceConfigs = []; + message.pscInterfaceConfigs.push($root.google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.outgoingServiceAttachmentLinks && message.outgoingServiceAttachmentLinks.length)) + message.outgoingServiceAttachmentLinks = []; + message.outgoingServiceAttachmentLinks.push(reader.string()); + break; + } + case 6: { + message.pscEnabled = reader.bool(); + 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.allowedConsumerNetworks != null && message.hasOwnProperty("allowedConsumerNetworks")) { + if (!Array.isArray(message.allowedConsumerNetworks)) + return "allowedConsumerNetworks: array expected"; + for (var i = 0; i < message.allowedConsumerNetworks.length; ++i) + if (!$util.isString(message.allowedConsumerNetworks[i])) + return "allowedConsumerNetworks: 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.outgoingServiceAttachmentLinks != null && message.hasOwnProperty("outgoingServiceAttachmentLinks")) { + if (!Array.isArray(message.outgoingServiceAttachmentLinks)) + return "outgoingServiceAttachmentLinks: array expected"; + for (var i = 0; i < message.outgoingServiceAttachmentLinks.length; ++i) + if (!$util.isString(message.outgoingServiceAttachmentLinks[i])) + return "outgoingServiceAttachmentLinks: string[] expected"; + } + if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) + if (typeof message.pscEnabled !== "boolean") + return "pscEnabled: boolean expected"; + 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.allowedConsumerNetworks) { + if (!Array.isArray(object.allowedConsumerNetworks)) + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.allowedConsumerNetworks: array expected"); + message.allowedConsumerNetworks = []; + for (var i = 0; i < object.allowedConsumerNetworks.length; ++i) + message.allowedConsumerNetworks[i] = String(object.allowedConsumerNetworks[i]); + } + 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.outgoingServiceAttachmentLinks) { + if (!Array.isArray(object.outgoingServiceAttachmentLinks)) + throw TypeError(".google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.outgoingServiceAttachmentLinks: array expected"); + message.outgoingServiceAttachmentLinks = []; + for (var i = 0; i < object.outgoingServiceAttachmentLinks.length; ++i) + message.outgoingServiceAttachmentLinks[i] = String(object.outgoingServiceAttachmentLinks[i]); + } + if (object.pscEnabled != null) + message.pscEnabled = Boolean(object.pscEnabled); + 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.allowedConsumerNetworks = []; + object.pscInterfaceConfigs = []; + object.outgoingServiceAttachmentLinks = []; + } + if (options.defaults) { + object.serviceAttachmentLink = ""; + object.pscEnabled = false; + } + 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.allowedConsumerNetworks && message.allowedConsumerNetworks.length) { + object.allowedConsumerNetworks = []; + for (var j = 0; j < message.allowedConsumerNetworks.length; ++j) + object.allowedConsumerNetworks[j] = message.allowedConsumerNetworks[j]; + } + 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.outgoingServiceAttachmentLinks && message.outgoingServiceAttachmentLinks.length) { + object.outgoingServiceAttachmentLinks = []; + for (var j = 0; j < message.outgoingServiceAttachmentLinks.length; ++j) + object.outgoingServiceAttachmentLinks[j] = message.outgoingServiceAttachmentLinks[j]; + } + if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) + object.pscEnabled = message.pscEnabled; + 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 + */ + + /** + * 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; + + /** + * 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); + 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) { + 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(); + 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; + } + 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"; + 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); + 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; + 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; + 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) { + 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(); + 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; + })(); + + /** + * 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; + })(); + + 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) { + 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(); + 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 {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 + */ + + /** + * 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 = {}; + if (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 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; + + /** + * 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); + 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) { + 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(); + 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 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; + } + 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.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: + break; + } + 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.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; + } + 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 = {}; + } + 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; + } + 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; + 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) { + 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(); + 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} [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 + */ + + /** + * 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 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; + + // 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) + }); + + /** + * 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(); + 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) { + 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(); + 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 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; + } + 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.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: + break; + } + } + if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) + if (typeof message.requiresDbRestart !== "boolean") + return "requiresDbRestart: boolean expected"; + 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.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; + } + } + if (object.requiresDbRestart != null) + message.requiresDbRestart = Boolean(object.requiresDbRestart); + 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; + } + 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"; + } + 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) { + 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(); + 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) { + 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(); + 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; + })(); + + 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 + */ + + /** + * 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; + + /** + * 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); + 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) { + 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(); + 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; + } + 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; + } + 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; + } + 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; + } + 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; + 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 + */ + + /** + * 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 = ""; + + /** + * 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); + 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.charset = reader.string(); + break; + } + case 3: { + message.collation = reader.string(); + 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"; + 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"; + 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); + 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 = ""; + } + 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; + 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; + })(); + + 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|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|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|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 + */ + + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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.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) { + 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(); + 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.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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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) { + if (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; + + /** + * 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); + 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) { + 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(); + 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 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"; + 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); + 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.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 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.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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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 = ""; + + /** + * 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); + 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.parent = 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 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"; + 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); + 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 = ""; + } + 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; + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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.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 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"|undefined} requestSpecific + * @memberof google.cloud.alloydb.v1alpha.OperationMetadata + * @instance + */ + Object.defineProperty(OperationMetadata.prototype, "requestSpecific", { + get: $util.oneOfGetter($oneOfFields = ["batchCreateInstancesMetadata"]), + 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(); + 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) { + 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(); + switch (tag >>> 3) { + case 8: { + message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.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.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.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"; + } + 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.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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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; + })(); + + return v1alpha; + })(); + + 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.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) { + 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(); + 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; + })(); + + 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) { + 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(); + 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) { + 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(); + 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.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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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; + })(); + + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * 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.fieldInfo. + * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldInfo"] = null; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = 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) { + 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(); + 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 291403980: { + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.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.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; + } + 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; + } + 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.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"]); + } + 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"]); + } + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 = {}; + + /** + * 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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/v1alpha/protos/protos.json b/owl-bot-staging/google-cloud-alloydb/v1alpha/protos/protos.json new file mode 100644 index 00000000000..b367bc0931a --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/protos/protos.json @@ -0,0 +1,5762 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "alloydb": { + "nested": { + "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": "ServiceProto", + "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/Network", + "(google.api.resource_definition).pattern": "projects/{project}/global/networks/{network}" + }, + "nested": { + "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 + } + }, + "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 + } + } + }, + "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" + } + } + } + }, + "Cluster": { + "options": { + "(google.api.resource).type": "alloydb.googleapis.com/Cluster", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "oneofs": { + "source": { + "oneof": [ + "backupSource", + "migrationSource" + ] + } + }, + "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" + } + }, + "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" + } + } + }, + "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 + } + } + }, + "PrimaryConfig": { + "fields": { + "secondaryClusterNames": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "PscConfig": { + "fields": { + "pscEnabled": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "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).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 + }, + "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_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" + } + } + }, + "nested": { + "MachineConfig": { + "fields": { + "cpuCount": { + "type": "int32", + "id": 1 + } + } + }, + "Node": { + "fields": { + "zoneId": { + "type": "string", + "id": 1 + }, + "id": { + "type": "string", + "id": 2 + }, + "ip": { + "type": "string", + "id": 3 + }, + "state": { + "type": "string", + "id": 4 + } + } + }, + "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 + } + } + } + }, + "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": { + "consumerEndpointIps": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "networkAttachment": { + "type": "string", + "id": 2 + } + } + }, + "PscInstanceConfig": { + "fields": { + "serviceAttachmentLink": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "allowedConsumerProjects": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowedConsumerNetworks": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pscInterfaceConfigs": { + "rule": "repeated", + "type": "PscInterfaceConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outgoingServiceAttachmentLinks": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pscEnabled": { + "type": "bool", + "id": 6, + "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" + } + } + }, + "nested": { + "AuthorizedNetwork": { + "fields": { + "cidrRange": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_info).format": "IPV4" + } + } + } + } + } + }, + "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 + } + } + } + }, + "ConnectionInfo": { + "options": { + "(google.api.resource).type": "alloydb.googleapis.com/ConnectionInfo", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/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).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" + } + }, + "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" + } + } + }, + "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}" + }, + "oneofs": { + "restrictions": { + "oneof": [ + "stringRestrictions", + "integerRestrictions" + ] + } + }, + "fields": { + "stringRestrictions": { + "type": "StringRestrictions", + "id": 7 + }, + "integerRestrictions": { + "type": "IntegerRestrictions", + "id": 8 + }, + "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 + } + }, + "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 + } + } + } + }, + "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).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" + } + } + }, + "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" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "charset": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "collation": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "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" + } + } + ] + }, + "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" + } + } + ] + }, + "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" + } + } + ] + }, + "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" + } + ] + } + } + }, + "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" + } + } + } + }, + "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" + } + } + } + }, + "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" + } + } + } + }, + "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 + } + } + }, + "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" + ] + } + }, + "fields": { + "batchCreateInstancesMetadata": { + "type": "BatchCreateInstancesMetadata", + "id": 8, + "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" + } + } + } + }, + "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 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api;api", + "java_multiple_files": true, + "java_outer_classname": "LaunchStageProto", + "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 + } + }, + "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 + } + } + } + }, + "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 + } + } + }, + "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 + } + } + } + }, + "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": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "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": { + "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, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "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": { + "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": { + "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": { + "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": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "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": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "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": { + "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": { + "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": { + "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, + "options": { + "packed": false + } + }, + "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": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "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": { + "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": { + "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": { + "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": { + "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": { + "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": { + "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": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "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": { + "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", + "cc_enable_arenas": true + }, + "nested": { + "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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js new file mode 100644 index 00000000000..6d5b16a322c --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js @@ -0,0 +1,81 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_backup.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_backup.js new file mode 100644 index 00000000000..d4a23cbe949 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_backup.js @@ -0,0 +1,91 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js new file mode 100644 index 00000000000..c65274beab4 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js @@ -0,0 +1,93 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating 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 (e.g. permission checks and + * any other type of validation), but do 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_instance.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_instance.js new file mode 100644 index 00000000000..709cd563606 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_instance.js @@ -0,0 +1,93 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating 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 (e.g. permission checks and + * any other type of validation), but do 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js new file mode 100644 index 00000000000..98b5c37ad22 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js @@ -0,0 +1,93 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating 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 (e.g. permission checks and + * any other type of validation), but do 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js new file mode 100644 index 00000000000..422c1934e11 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js @@ -0,0 +1,93 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating 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 (e.g. permission checks and + * any other type of validation), but do 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_user.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_user.js new file mode 100644 index 00000000000..a889fa6c6b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_user.js @@ -0,0 +1,90 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js new file mode 100644 index 00000000000..b4dbcd61d12 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js @@ -0,0 +1,88 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js new file mode 100644 index 00000000000..6a0f8a0e943 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js @@ -0,0 +1,92 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // 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 (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + */ + // 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js new file mode 100644 index 00000000000..818fb128871 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js @@ -0,0 +1,88 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // 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 (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + */ + // 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js new file mode 100644 index 00000000000..b3fd509453e --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js @@ -0,0 +1,81 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js new file mode 100644 index 00000000000..4ce4c2c9f7e --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js @@ -0,0 +1,82 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the failover. + */ + // 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js new file mode 100644 index 00000000000..44a96df8881 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js @@ -0,0 +1,99 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // 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 + * ceritificate 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_backup.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_backup.js new file mode 100644 index 00000000000..0a74134f9fd --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_backup.js @@ -0,0 +1,61 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js new file mode 100644 index 00000000000..bccd6a9ce28 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js @@ -0,0 +1,67 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js new file mode 100644 index 00000000000..0dbfe505308 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js @@ -0,0 +1,76 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_instance.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_instance.js new file mode 100644 index 00000000000..1fc985b7e37 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_instance.js @@ -0,0 +1,66 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_user.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_user.js new file mode 100644 index 00000000000..7f70b5937ba --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_user.js @@ -0,0 +1,62 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js new file mode 100644 index 00000000000..b22ccc99fae --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js @@ -0,0 +1,88 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the fault + * injection. + */ + // 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_backups.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_backups.js new file mode 100644 index 00000000000..53e52fe2ffd --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_backups.js @@ -0,0 +1,80 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js new file mode 100644 index 00000000000..ed4e90d94d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js @@ -0,0 +1,83 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_databases.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_databases.js new file mode 100644 index 00000000000..3b9770aa516 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_databases.js @@ -0,0 +1,81 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, an appropriate number of databases + * will be returned. The max value will be 2000, 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_instances.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_instances.js new file mode 100644 index 00000000000..87a01b0ff90 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_instances.js @@ -0,0 +1,85 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js new file mode 100644 index 00000000000..e198bcb7061 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js @@ -0,0 +1,77 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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' + + // 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_users.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_users.js new file mode 100644 index 00000000000..f94287e2519 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_users.js @@ -0,0 +1,80 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js new file mode 100644 index 00000000000..9d00328cb06 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js @@ -0,0 +1,88 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // 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 (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + */ + // 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js new file mode 100644 index 00000000000..0cc6d85f219 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js @@ -0,0 +1,82 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the restart. + */ + // const validateOnly = true + + // 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js new file mode 100644 index 00000000000..3a70c6354f9 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js @@ -0,0 +1,102 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating 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 (e.g. permission checks and + * any other type of validation), but do not actually execute the import + * 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_backup.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_backup.js new file mode 100644 index 00000000000..adc09dfe701 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_backup.js @@ -0,0 +1,94 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js new file mode 100644 index 00000000000..ad995dd5a91 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js @@ -0,0 +1,95 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating 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 (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_instance.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_instance.js new file mode 100644 index 00000000000..d20a503fce4 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_instance.js @@ -0,0 +1,95 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating 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 (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_user.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_user.js new file mode 100644 index 00000000000..fab59af7d9e --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_user.js @@ -0,0 +1,92 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating 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/v1alpha/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json new file mode 100644 index 00000000000..f40496a17ad --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json @@ -0,0 +1,1691 @@ +{ + "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_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": 84, + "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": 80, + "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_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": 80, + "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": 74, + "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": 74, + "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" + } + ], + "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_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": 69, + "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" + } + ], + "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" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/src/index.ts b/owl-bot-staging/google-cloud-alloydb/v1alpha/src/index.ts new file mode 100644 index 00000000000..72c99e931d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 v1alpha from './v1alpha'; +const AlloyDBAdminClient = v1alpha.AlloyDBAdminClient; +type AlloyDBAdminClient = v1alpha.AlloyDBAdminClient; +export {v1alpha, AlloyDBAdminClient}; +export default {v1alpha, AlloyDBAdminClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/alloy_d_b_admin_client.ts b/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/alloy_d_b_admin_client.ts new file mode 100644 index 00000000000..85ee3ba5144 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/alloy_d_b_admin_client.ts @@ -0,0 +1,5218 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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'); + +/** + * 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; + 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://developers.google.com/identity/protocols/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.protobuf.Root.fromJSON(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 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 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)), + 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)), + 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', 'deleteCluster', 'promoteCluster', 'restoreCluster', 'createSecondaryCluster', 'listInstances', 'getInstance', 'createInstance', 'createSecondaryInstance', 'batchCreateInstances', 'updateInstance', 'deleteInstance', 'failoverInstance', 'injectFault', 'restartInstance', '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.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(); + return this.innerApiCalls.getCluster(request, options, callback); + } +/** + * 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(); + return this.innerApiCalls.getInstance(request, options, callback); + } +/** + * 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(); + return this.innerApiCalls.getBackup(request, options, callback); + } +/** + * 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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 + * ceritificate 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(); + return this.innerApiCalls.generateClientCertificate(request, options, callback); + } +/** + * 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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(); + return this.innerApiCalls.getConnectionInfo(request, options, callback); + } +/** + * 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(); + return this.innerApiCalls.getUser(request, options, callback); + } +/** + * 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate 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(); + return this.innerApiCalls.createUser(request, options, callback); + } +/** + * 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate 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(); + return this.innerApiCalls.updateUser(request, options, callback); + } +/** + * 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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(); + return this.innerApiCalls.deleteUser(request, options, callback); + } + +/** + * 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate 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 (e.g. permission checks and + * any other type of validation), but do 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(); + return this.innerApiCalls.createCluster(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate 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 (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * 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(); + return this.innerApiCalls.updateCluster(request, options, callback); + } +/** + * 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>{ + 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; + } +/** + * 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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 (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * @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(); + return this.innerApiCalls.deleteCluster(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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 (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * @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(); + return this.innerApiCalls.promoteCluster(request, options, callback); + } +/** + * 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>{ + 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; + } +/** + * 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate 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 (e.g. permission checks and + * any other type of validation), but do not actually execute the import + * 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(); + return this.innerApiCalls.restoreCluster(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate 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 (e.g. permission checks and + * any other type of validation), but do 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(); + return this.innerApiCalls.createSecondaryCluster(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate 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 (e.g. permission checks and + * any other type of validation), but do 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(); + return this.innerApiCalls.createInstance(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate 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 (e.g. permission checks and + * any other type of validation), but do 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(); + return this.innerApiCalls.createSecondaryInstance(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate 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(); + return this.innerApiCalls.batchCreateInstances(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate 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 (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * 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(); + return this.innerApiCalls.updateInstance(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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 (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * @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(); + return this.innerApiCalls.deleteInstance(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the failover. + * @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(); + return this.innerApiCalls.failoverInstance(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the fault + * injection. + * @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(); + return this.innerApiCalls.injectFault(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the restart. + * @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(); + return this.innerApiCalls.restartInstance(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate 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(); + return this.innerApiCalls.createBackup(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate 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(); + return this.innerApiCalls.updateBackup(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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(); + return this.innerApiCalls.deleteBackup(request, options, callback); + } +/** + * 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>{ + 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(); + return this.innerApiCalls.listClusters(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, 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(); + 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(); + 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(); + return this.innerApiCalls.listInstances(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, 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(); + 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(); + 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(); + return this.innerApiCalls.listBackups(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, 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(); + 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(); + 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 {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(); + return this.innerApiCalls.listSupportedDatabaseFlags(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, 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 {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(); + 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 {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(); + 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(); + return this.innerApiCalls.listUsers(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, 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(); + 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(); + 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, an appropriate number of databases + * will be returned. The max value will be 2000, 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(); + return this.innerApiCalls.listDatabases(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, 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, an appropriate number of databases + * will be returned. The max value will be 2000, 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(); + 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, an appropriate number of databases + * will be returned. The max value will be 2000, 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(); + 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, + options?: + | 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]> { + 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 { + 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, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + 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, + options?: + | 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 { + 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._terminated = true; + stub.close(); + this.iamClient.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/alloy_d_b_admin_client_config.json b/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/alloy_d_b_admin_client_config.json new file mode 100644 index 00000000000..7797b0882b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/alloy_d_b_admin_client_config.json @@ -0,0 +1,198 @@ +{ + "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" + }, + "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" + }, + "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" + }, + "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" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/alloy_d_b_admin_proto_list.json b/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/alloy_d_b_admin_proto_list.json new file mode 100644 index 00000000000..d0ed20f71a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/alloy_d_b_admin_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/cloud/alloydb/v1alpha/resources.proto", + "../../protos/google/cloud/alloydb/v1alpha/service.proto" +] diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/gapic_metadata.json b/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/gapic_metadata.json new file mode 100644 index 00000000000..d6cc2fd9d80 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/gapic_metadata.json @@ -0,0 +1,367 @@ +{ + "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" + ] + }, + "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" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "PromoteCluster": { + "methods": [ + "promoteCluster" + ] + }, + "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" + ] + }, + "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" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "PromoteCluster": { + "methods": [ + "promoteCluster" + ] + }, + "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" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/index.ts b/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/index.ts new file mode 100644 index 00000000000..93eec87dc06 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/index.ts @@ -0,0 +1,19 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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'; diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..f26aa8e2c06 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-alloydb/v1alpha/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..bd7a760f403 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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} from '@google-cloud/alloydb'; + +// check that the client class type name can be used +function doStuffWithAlloyDBAdminClient(client: AlloyDBAdminClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const alloyDBAdminClient = new AlloyDBAdminClient(); + doStuffWithAlloyDBAdminClient(alloyDBAdminClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/system-test/install.ts b/owl-bot-staging/google-cloud-alloydb/v1alpha/system-test/install.ts new file mode 100644 index 00000000000..fd5bfdc71d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1alpha/test/gapic_alloy_d_b_admin_v1alpha.ts b/owl-bot-staging/google-cloud-alloydb/v1alpha/test/gapic_alloy_d_b_admin_v1alpha.ts new file mode 100644 index 00000000000..3adc2c4aa8f --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/test/gapic_alloy_d_b_admin_v1alpha.ts @@ -0,0 +1,6475 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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(); + assert(client.alloyDBAdminStub); + client.close().then(() => { + done(); + }); + }); + + 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(); + }); + }); + + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + await assert.rejects(client.getInstance(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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + await assert.rejects(client.deleteUser(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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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('deleteCluster', () => { + it('invokes deleteCluster without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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('restoreCluster', () => { + it('invokes restoreCluster without error', async () => { + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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); + } + }); + }); + 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', + }); + 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', + }); + 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', + }); + 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); + } + }); + }); + 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', + }); + 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', + }); + 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', + }); + 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); + } + }); + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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); + } + }); + }); + 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', + }); + 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); + } + }); + }); + 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', + }); + 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); + } + }); + }); + 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.ListOperationsResponse[] = []; + 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', + }); + 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.ListOperationsResponse[] = []; + 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', () => { + 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', + }); + 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', () => { + 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', + }); + 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', () => { + 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', + }); + 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', () => { + 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', + }); + 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', () => { + 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', + }); + 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', () => { + 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', + }); + 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', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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', () => { + 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', + }); + 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', () => { + 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', + }); + 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/v1alpha/tsconfig.json b/owl-bot-staging/google-cloud-alloydb/v1alpha/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/webpack.config.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/webpack.config.js new file mode 100644 index 00000000000..ee88fe6afc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1alpha/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', +}; diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/.eslintignore b/owl-bot-staging/google-cloud-alloydb/v1beta/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/.eslintrc.json b/owl-bot-staging/google-cloud-alloydb/v1beta/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/.gitignore b/owl-bot-staging/google-cloud-alloydb/v1beta/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/.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/v1beta/.jsdoc.js b/owl-bot-staging/google-cloud-alloydb/v1beta/.jsdoc.js new file mode 100644 index 00000000000..6c10f22a83a --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 2024 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/v1beta/.mocharc.js b/owl-bot-staging/google-cloud-alloydb/v1beta/.mocharc.js new file mode 100644 index 00000000000..13b67c34edc --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1beta/.prettierrc.js b/owl-bot-staging/google-cloud-alloydb/v1beta/.prettierrc.js new file mode 100644 index 00000000000..9a8fd690982 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1beta/README.md b/owl-bot-staging/google-cloud-alloydb/v1beta/README.md new file mode 100644 index 00000000000..433e5333737 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/README.md @@ -0,0 +1 @@ +Alloydb: Nodejs Client diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/package.json b/owl-bot-staging/google-cloud-alloydb/v1beta/package.json new file mode 100644 index 00000000000..7d0d731ff2e --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/package.json @@ -0,0 +1,58 @@ +{ + "name": "@google-cloud/alloydb", + "version": "0.1.0", + "description": "Alloydb client for Node.js", + "repository": "googleapis/nodejs-alloydb", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google alloydb", + "alloydb", + "alloy d b admin" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^4.3.4" + }, + "devDependencies": { + "@types/mocha": "^10.0.6", + "@types/node": "^20.12.12", + "@types/sinon": "^10.0.20", + "c8": "^9.1.0", + "gapic-tools": "^0.4.2", + "gts": "5.3.0", + "jsdoc": "^4.0.3", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "mocha": "^10.4.0", + "pack-n-play": "^2.0.3", + "sinon": "^15.2.0", + "typescript": "5.1.6" + }, + "engines": { + "node": ">=v14" + } +} diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/protos/google/cloud/alloydb/v1beta/resources.proto b/owl-bot-staging/google-cloud-alloydb/v1beta/protos/google/cloud/alloydb/v1beta/resources.proto new file mode 100644 index 00000000000..4fee0dc94ba --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/protos/google/cloud/alloydb/v1beta/resources.proto @@ -0,0 +1,1386 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.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}" +}; + +// 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 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; +} + +// 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 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, e.g. via + // 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 then use default encryption scheme to + // protect the user data. + 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 then use default encryption scheme to + // protect the user data. + 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. Output + // only field. Ignored if passed into the request. + repeated google.type.DayOfWeek schedule = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The earliest restorable time that can be restored to. Output + // only field. + 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; + } + + // Preferred windows to perform maintenance. Currently limited to 1. + repeated MaintenanceWindow maintenance_windows = 1; +} + +// 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}" + 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; + } + + // 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]; + } + + // Cluster State + enum State { + // The state of the cluster is unknown. + STATE_UNSPECIFIED = 0; + + // The cluster is active and running. + READY = 1; + + // The cluster is stopped. All instances in the cluster are stopped. + // Customers can start a stopped cluster at any point and all their + // instances will come back to life with same names and IP resources. In + // this state, customer pays for storage. + // Associated backups could also be present in a stopped cluster. + 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. 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 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]; +} + +// 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}" + 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; + } + + // Details of a single node in the instance. + // Nodes in an AlloyDB instance are ephemereal, they can change during + // update, failover, autohealing and resize operations. + message Node { + // The Compute Engine zone of the VM e.g. "us-central1-b". + string zone_id = 1; + + // The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". + string id = 2; + + // The private IP address of the VM e.g. "10.57.0.34". + string ip = 3; + + // 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; + } + + // 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; + } + + // 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 config option for this instance. + SslConfig ssl_config = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration for setting up a PSC interface. This information needs to be + // provided by the customer. + // PSC interfaces will be created and added to VMs via SLM (adding a network + // interface will require recreating the VM). For HA instances this will be + // done via LDTM. + message PscInterfaceConfig { + // A list of endpoints in the consumer VPC the interface might initiate + // outbound connections to. This list has to be provided when the PSC + // interface is created. + repeated string consumer_endpoint_ips = 1; + + // The NetworkAttachment resource created in the consumer VPC to which the + // PSC interface will be linked, in the form of: + // `projects/${CONSUMER_PROJECT}/regions/${REGION}/networkAttachments/${NETWORK_ATTACHMENT_NAME}`. + // NetworkAttachment has to be provided when the PSC interface is created. + string network_attachment = 2; + } + + // 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]; + + // 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]; + + // Optional. List of consumer networks that are allowed to create + // PSC endpoints to service-attachments to this instance. + repeated string allowed_consumer_networks = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // 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. All the VMs created for the primary + // instance will share the same configurations. Currently we only support 0 + // or 1 PSC interface. + repeated PscInterfaceConfig psc_interface_configs = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of service attachments that this instance has created + // endpoints to connect with. Currently, only a single outgoing service + // attachment is supported per instance. + repeated string outgoing_service_attachment_links = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether PSC connectivity is enabled for this instance. + // This is populated by referencing the value from the parent cluster. + bool psc_enabled = 6 [(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]; + } + + // 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; + } + + // 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 instance level. + // * They are copied from primary instance on read instance creation. + // * Read instances can set new or override existing flags that are relevant + // for reads, e.g. for enabling columnar cache on a read instance. Flags + // set on read instance may or may not be present on primary. + // + // + // 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; + + // 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]; + + // 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 + ]; +} + +// 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" + }; + + // 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}" + 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 + 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]; + + // 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]; +} + +// 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}" + }; + + // 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 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 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; +} + +// Message describing User object. +message User { + option (google.api.resource) = { + type: "alloydb.googleapis.com/User" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}/users/{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]; +} + +// 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. 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]; + + // Optional. Collation for the database. + // Name of the custom or native collation for postgres. + // Example values include "C", "POSIX", etc + string collation = 3 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/protos/google/cloud/alloydb/v1beta/service.proto b/owl-bot-staging/google-cloud-alloydb/v1beta/protos/google/cloud/alloydb/v1beta/service.proto new file mode 100644 index 00000000000..5a7a1cb0fad --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/protos/google/cloud/alloydb/v1beta/service.proto @@ -0,0 +1,1641 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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/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" + }; + } + + // 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" + }; + } + + // 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" + }; + } + + // 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"; + } +} + +// 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating 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 (e.g. permission checks and + // any other type of validation), but do 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating 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 (e.g. permission checks and + // any other type of validation), but do 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating 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 (e.g. permission checks and + // any other type of validation), but do not actually execute the update + // 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]; +} + +// 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + 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 (e.g. permission checks and + // any other type of validation), but do not actually execute the delete. + 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 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + 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 (e.g. permission checks and + // any other type of validation), but do not actually execute the delete. + 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. +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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating 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 (e.g. permission checks and + // any other type of validation), but do not actually execute the import + // 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating 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 (e.g. permission checks and + // any other type of validation), but do 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating 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 (e.g. permission checks and + // any other type of validation), but do 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating 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 + // processsing 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating 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 (e.g. permission checks and + // any other type of validation), but do not actually execute the update + // 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + 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 (e.g. permission checks and + // any other type of validation), but do not actually execute the delete. + 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the failover. + 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the fault + // injection. + 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, performs request validation (e.g. permission checks and + // any other type of validation), but do not actually execute the restart. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + 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; +} + +// 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + 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 + // ceritificate 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + 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. 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 [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 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating 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 will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + 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 requesting list of Databases. +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, an appropriate number of databases + // will be returned. The max value will be 2000, 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 response to listing Databases. +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/v1beta/protos/protos.d.ts b/owl-bot-staging/google-cloud-alloydb/v1beta/protos/protos.d.ts new file mode 100644 index 00000000000..592d8296994 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/protos/protos.d.ts @@ -0,0 +1,19466 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 v1beta. */ + namespace v1beta { + + /** 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 + } + + /** 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"); + + /** AutomatedBackupPolicy _enabled. */ + public _enabled?: "enabled"; + + /** + * 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); + + /** ContinuousBackupConfig _enabled. */ + public _enabled?: "enabled"; + + /** + * 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); + } + + /** 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[]; + + /** + * 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 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 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 maintenanceUpdatePolicy */ + maintenanceUpdatePolicy?: (google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy|null); + + /** Cluster maintenanceSchedule */ + maintenanceSchedule?: (google.cloud.alloydb.v1beta.IMaintenanceSchedule|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 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 maintenanceUpdatePolicy. */ + public maintenanceUpdatePolicy?: (google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy|null); + + /** Cluster maintenanceSchedule. */ + public maintenanceSchedule?: (google.cloud.alloydb.v1beta.IMaintenanceSchedule|null); + + /** Cluster source. */ + public source?: ("backupSource"|"migrationSource"); + + /** + * 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; + } + + /** 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 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 outboundPublicIpAddresses */ + outboundPublicIpAddresses?: (string[]|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 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 outboundPublicIpAddresses. */ + public outboundPublicIpAddresses: string[]; + + /** + * 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); + } + + /** 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; + + /** + * 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); + + /** QueryInsightsInstanceConfig _recordApplicationTags. */ + public _recordApplicationTags?: "recordApplicationTags"; + + /** QueryInsightsInstanceConfig _recordClientAddress. */ + public _recordClientAddress?: "recordClientAddress"; + + /** QueryInsightsInstanceConfig _queryPlansPerMinute. */ + public _queryPlansPerMinute?: "queryPlansPerMinute"; + + /** + * 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 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 consumerEndpointIps */ + consumerEndpointIps?: (string[]|null); + + /** PscInterfaceConfig networkAttachment */ + networkAttachment?: (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 consumerEndpointIps. */ + public consumerEndpointIps: string[]; + + /** PscInterfaceConfig networkAttachment. */ + public networkAttachment: 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 PscInstanceConfig. */ + interface IPscInstanceConfig { + + /** PscInstanceConfig serviceAttachmentLink */ + serviceAttachmentLink?: (string|null); + + /** PscInstanceConfig allowedConsumerProjects */ + allowedConsumerProjects?: (string[]|null); + + /** PscInstanceConfig allowedConsumerNetworks */ + allowedConsumerNetworks?: (string[]|null); + + /** PscInstanceConfig pscInterfaceConfigs */ + pscInterfaceConfigs?: (google.cloud.alloydb.v1beta.Instance.IPscInterfaceConfig[]|null); + + /** PscInstanceConfig outgoingServiceAttachmentLinks */ + outgoingServiceAttachmentLinks?: (string[]|null); + + /** PscInstanceConfig pscEnabled */ + pscEnabled?: (boolean|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 allowedConsumerNetworks. */ + public allowedConsumerNetworks: string[]; + + /** PscInstanceConfig pscInterfaceConfigs. */ + public pscInterfaceConfigs: google.cloud.alloydb.v1beta.Instance.IPscInterfaceConfig[]; + + /** PscInstanceConfig outgoingServiceAttachmentLinks. */ + public outgoingServiceAttachmentLinks: string[]; + + /** PscInstanceConfig pscEnabled. */ + public pscEnabled: boolean; + + /** + * 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); + } + + /** 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; + + /** + * 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; + } + } + + /** 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 + } + } + + /** 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 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); + } + + /** 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 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); + + /** + * 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 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); + } + + /** 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 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 restrictions. */ + public restrictions?: ("stringRestrictions"|"integerRestrictions"); + + /** + * 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 + } + } + + /** 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); + } + + /** 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); + + /** + * 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); + } + + /** 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; + + /** + * 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; + } + + /** 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 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 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 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; + } + + 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|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|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|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; + } + + /** 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 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 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); + } + + /** 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; + + /** + * 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 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); + } + + /** 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; + + /** + * 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 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 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"; + + /** + * 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 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; + } + } + } + } + + /** 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 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 + } + } + + /** 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 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 + } + } + + /** 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.fieldInfo */ + ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|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|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|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|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|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|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|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 { + + /** 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/v1beta/protos/protos.js b/owl-bot-staging/google-cloud-alloydb/v1beta/protos/protos.js new file mode 100644 index 00000000000..c1f35e20232 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/protos/protos.js @@ -0,0 +1,50335 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.v1beta = (function() { + + /** + * Namespace v1beta. + * @memberof google.cloud.alloydb + * @namespace + */ + var v1beta = {}; + + /** + * 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 + */ + 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; + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) + }); + + /** + * AutomatedBackupPolicy _enabled. + * @member {"enabled"|undefined} _enabled + * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy + * @instance + */ + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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; + + /** + * ContinuousBackupConfig _enabled. + * @member {"enabled"|undefined} _enabled + * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig + * @instance + */ + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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 = []; + if (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; + + /** + * 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(); + 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) { + 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(); + 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; + } + 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; + } + } + 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]); + } + } + 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 = []; + 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); + } + 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) { + 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(); + 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; + })(); + + 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) { + 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(); + 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 {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.IMaintenanceUpdatePolicy|null} [maintenanceUpdatePolicy] Cluster maintenanceUpdatePolicy + * @property {google.cloud.alloydb.v1beta.IMaintenanceSchedule|null} [maintenanceSchedule] Cluster maintenanceSchedule + */ + + /** + * 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 = {}; + if (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 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 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; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Cluster source. + * @member {"backupSource"|"migrationSource"|undefined} source + * @memberof google.cloud.alloydb.v1beta.Cluster + * @instance + */ + Object.defineProperty(Cluster.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["backupSource", "migrationSource"]), + 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.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.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(); + 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) { + 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(); + 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 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 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; + } + 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.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: + 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.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; + } + 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.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; + } + 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.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); + } + 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 = {}; + } + 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.maintenanceUpdatePolicy = null; + object.maintenanceSchedule = 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.maintenanceUpdatePolicy != null && message.hasOwnProperty("maintenanceUpdatePolicy")) + object.maintenanceUpdatePolicy = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.toObject(message.maintenanceUpdatePolicy, options); + if (message.maintenanceSchedule != null && message.hasOwnProperty("maintenanceSchedule")) + object.maintenanceSchedule = $root.google.cloud.alloydb.v1beta.MaintenanceSchedule.toObject(message.maintenanceSchedule, 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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; + })(); + + /** + * 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.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 {Array.|null} [outboundPublicIpAddresses] Instance outboundPublicIpAddresses + */ + + /** + * 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 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 outboundPublicIpAddresses. + * @member {Array.} outboundPublicIpAddresses + * @memberof google.cloud.alloydb.v1beta.Instance + * @instance + */ + Instance.prototype.outboundPublicIpAddresses = $util.emptyArray; + + /** + * 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.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.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]); + 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) { + 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(); + 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 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 34: { + if (!(message.outboundPublicIpAddresses && message.outboundPublicIpAddresses.length)) + message.outboundPublicIpAddresses = []; + message.outboundPublicIpAddresses.push(reader.string()); + 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.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.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"; + } + 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.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.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]); + } + 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.publicIpAddress = ""; + object.pscInstanceConfig = null; + object.networkConfig = 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.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.outboundPublicIpAddresses && message.outboundPublicIpAddresses.length) { + object.outboundPublicIpAddresses = []; + for (var j = 0; j < message.outboundPublicIpAddresses.length; ++j) + object.outboundPublicIpAddresses[j] = message.outboundPublicIpAddresses[j]; + } + 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 + */ + + /** + * 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; + + /** + * 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); + 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.cpuCount = reader.int32(); + 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"; + 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; + 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; + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + object.cpuCount = message.cpuCount; + 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) { + 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(); + 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; + + /** + * QueryInsightsInstanceConfig _recordApplicationTags. + * @member {"recordApplicationTags"|undefined} _recordApplicationTags + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @instance + */ + Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordApplicationTags", { + get: $util.oneOfGetter($oneOfFields = ["recordApplicationTags"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * QueryInsightsInstanceConfig _recordClientAddress. + * @member {"recordClientAddress"|undefined} _recordClientAddress + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @instance + */ + Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordClientAddress", { + get: $util.oneOfGetter($oneOfFields = ["recordClientAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * QueryInsightsInstanceConfig _queryPlansPerMinute. + * @member {"queryPlansPerMinute"|undefined} _queryPlansPerMinute + * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig + * @instance + */ + 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) { + 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(); + 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.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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 {Array.|null} [consumerEndpointIps] PscInterfaceConfig consumerEndpointIps + * @property {string|null} [networkAttachment] PscInterfaceConfig networkAttachment + */ + + /** + * 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) { + this.consumerEndpointIps = []; + if (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 consumerEndpointIps. + * @member {Array.} consumerEndpointIps + * @memberof google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig + * @instance + */ + PscInterfaceConfig.prototype.consumerEndpointIps = $util.emptyArray; + + /** + * PscInterfaceConfig networkAttachment. + * @member {string} networkAttachment + * @memberof google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig + * @instance + */ + PscInterfaceConfig.prototype.networkAttachment = ""; + + /** + * 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.consumerEndpointIps != null && message.consumerEndpointIps.length) + for (var i = 0; i < message.consumerEndpointIps.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.consumerEndpointIps[i]); + if (message.networkAttachment != null && Object.hasOwnProperty.call(message, "networkAttachment")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.networkAttachment); + 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) { + 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(); + switch (tag >>> 3) { + case 1: { + if (!(message.consumerEndpointIps && message.consumerEndpointIps.length)) + message.consumerEndpointIps = []; + message.consumerEndpointIps.push(reader.string()); + break; + } + case 2: { + message.networkAttachment = 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.consumerEndpointIps != null && message.hasOwnProperty("consumerEndpointIps")) { + if (!Array.isArray(message.consumerEndpointIps)) + return "consumerEndpointIps: array expected"; + for (var i = 0; i < message.consumerEndpointIps.length; ++i) + if (!$util.isString(message.consumerEndpointIps[i])) + return "consumerEndpointIps: string[] expected"; + } + if (message.networkAttachment != null && message.hasOwnProperty("networkAttachment")) + if (!$util.isString(message.networkAttachment)) + return "networkAttachment: 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.consumerEndpointIps) { + if (!Array.isArray(object.consumerEndpointIps)) + throw TypeError(".google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig.consumerEndpointIps: array expected"); + message.consumerEndpointIps = []; + for (var i = 0; i < object.consumerEndpointIps.length; ++i) + message.consumerEndpointIps[i] = String(object.consumerEndpointIps[i]); + } + if (object.networkAttachment != null) + message.networkAttachment = String(object.networkAttachment); + 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.arrays || options.defaults) + object.consumerEndpointIps = []; + if (options.defaults) + object.networkAttachment = ""; + if (message.consumerEndpointIps && message.consumerEndpointIps.length) { + object.consumerEndpointIps = []; + for (var j = 0; j < message.consumerEndpointIps.length; ++j) + object.consumerEndpointIps[j] = message.consumerEndpointIps[j]; + } + if (message.networkAttachment != null && message.hasOwnProperty("networkAttachment")) + object.networkAttachment = message.networkAttachment; + 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.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 {Array.|null} [allowedConsumerNetworks] PscInstanceConfig allowedConsumerNetworks + * @property {Array.|null} [pscInterfaceConfigs] PscInstanceConfig pscInterfaceConfigs + * @property {Array.|null} [outgoingServiceAttachmentLinks] PscInstanceConfig outgoingServiceAttachmentLinks + * @property {boolean|null} [pscEnabled] PscInstanceConfig pscEnabled + */ + + /** + * 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.allowedConsumerNetworks = []; + this.pscInterfaceConfigs = []; + this.outgoingServiceAttachmentLinks = []; + if (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 allowedConsumerNetworks. + * @member {Array.} allowedConsumerNetworks + * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig + * @instance + */ + PscInstanceConfig.prototype.allowedConsumerNetworks = $util.emptyArray; + + /** + * PscInstanceConfig pscInterfaceConfigs. + * @member {Array.} pscInterfaceConfigs + * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig + * @instance + */ + PscInstanceConfig.prototype.pscInterfaceConfigs = $util.emptyArray; + + /** + * PscInstanceConfig outgoingServiceAttachmentLinks. + * @member {Array.} outgoingServiceAttachmentLinks + * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig + * @instance + */ + PscInstanceConfig.prototype.outgoingServiceAttachmentLinks = $util.emptyArray; + + /** + * PscInstanceConfig pscEnabled. + * @member {boolean} pscEnabled + * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig + * @instance + */ + PscInstanceConfig.prototype.pscEnabled = false; + + /** + * 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.allowedConsumerNetworks != null && message.allowedConsumerNetworks.length) + for (var i = 0; i < message.allowedConsumerNetworks.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.allowedConsumerNetworks[i]); + 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 4, wireType 2 =*/34).fork()).ldelim(); + if (message.outgoingServiceAttachmentLinks != null && message.outgoingServiceAttachmentLinks.length) + for (var i = 0; i < message.outgoingServiceAttachmentLinks.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.outgoingServiceAttachmentLinks[i]); + if (message.pscEnabled != null && Object.hasOwnProperty.call(message, "pscEnabled")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.pscEnabled); + 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) { + 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(); + 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 3: { + if (!(message.allowedConsumerNetworks && message.allowedConsumerNetworks.length)) + message.allowedConsumerNetworks = []; + message.allowedConsumerNetworks.push(reader.string()); + break; + } + case 4: { + if (!(message.pscInterfaceConfigs && message.pscInterfaceConfigs.length)) + message.pscInterfaceConfigs = []; + message.pscInterfaceConfigs.push($root.google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.outgoingServiceAttachmentLinks && message.outgoingServiceAttachmentLinks.length)) + message.outgoingServiceAttachmentLinks = []; + message.outgoingServiceAttachmentLinks.push(reader.string()); + break; + } + case 6: { + message.pscEnabled = reader.bool(); + 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.allowedConsumerNetworks != null && message.hasOwnProperty("allowedConsumerNetworks")) { + if (!Array.isArray(message.allowedConsumerNetworks)) + return "allowedConsumerNetworks: array expected"; + for (var i = 0; i < message.allowedConsumerNetworks.length; ++i) + if (!$util.isString(message.allowedConsumerNetworks[i])) + return "allowedConsumerNetworks: 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.outgoingServiceAttachmentLinks != null && message.hasOwnProperty("outgoingServiceAttachmentLinks")) { + if (!Array.isArray(message.outgoingServiceAttachmentLinks)) + return "outgoingServiceAttachmentLinks: array expected"; + for (var i = 0; i < message.outgoingServiceAttachmentLinks.length; ++i) + if (!$util.isString(message.outgoingServiceAttachmentLinks[i])) + return "outgoingServiceAttachmentLinks: string[] expected"; + } + if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) + if (typeof message.pscEnabled !== "boolean") + return "pscEnabled: boolean expected"; + 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.allowedConsumerNetworks) { + if (!Array.isArray(object.allowedConsumerNetworks)) + throw TypeError(".google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.allowedConsumerNetworks: array expected"); + message.allowedConsumerNetworks = []; + for (var i = 0; i < object.allowedConsumerNetworks.length; ++i) + message.allowedConsumerNetworks[i] = String(object.allowedConsumerNetworks[i]); + } + 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.outgoingServiceAttachmentLinks) { + if (!Array.isArray(object.outgoingServiceAttachmentLinks)) + throw TypeError(".google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.outgoingServiceAttachmentLinks: array expected"); + message.outgoingServiceAttachmentLinks = []; + for (var i = 0; i < object.outgoingServiceAttachmentLinks.length; ++i) + message.outgoingServiceAttachmentLinks[i] = String(object.outgoingServiceAttachmentLinks[i]); + } + if (object.pscEnabled != null) + message.pscEnabled = Boolean(object.pscEnabled); + 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.allowedConsumerNetworks = []; + object.pscInterfaceConfigs = []; + object.outgoingServiceAttachmentLinks = []; + } + if (options.defaults) { + object.serviceAttachmentLink = ""; + object.pscEnabled = false; + } + 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.allowedConsumerNetworks && message.allowedConsumerNetworks.length) { + object.allowedConsumerNetworks = []; + for (var j = 0; j < message.allowedConsumerNetworks.length; ++j) + object.allowedConsumerNetworks[j] = message.allowedConsumerNetworks[j]; + } + 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.outgoingServiceAttachmentLinks && message.outgoingServiceAttachmentLinks.length) { + object.outgoingServiceAttachmentLinks = []; + for (var j = 0; j < message.outgoingServiceAttachmentLinks.length; ++j) + object.outgoingServiceAttachmentLinks[j] = message.outgoingServiceAttachmentLinks[j]; + } + if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) + object.pscEnabled = message.pscEnabled; + 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 + */ + + /** + * 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; + + /** + * 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); + 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) { + 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(); + 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; + } + 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"; + 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); + 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; + } + 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; + 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) { + 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(); + 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; + })(); + + /** + * 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; + })(); + + 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) { + 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(); + 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 {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 + */ + + /** + * 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 = {}; + if (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 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; + + /** + * 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); + 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) { + 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(); + 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 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; + } + 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.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: + break; + } + 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.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; + } + 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 = {}; + } + 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; + } + 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; + 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) { + 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(); + 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} [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 + */ + + /** + * 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 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; + + // 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) + }); + + /** + * 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(); + 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) { + 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(); + 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 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; + } + 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.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: + break; + } + } + if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) + if (typeof message.requiresDbRestart !== "boolean") + return "requiresDbRestart: boolean expected"; + 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.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; + } + } + if (object.requiresDbRestart != null) + message.requiresDbRestart = Boolean(object.requiresDbRestart); + 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; + } + 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"; + } + 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) { + 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(); + 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) { + 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(); + 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; + })(); + + 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 + */ + + /** + * 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; + + /** + * 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); + 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) { + 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(); + 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; + } + 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; + } + 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; + } + 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; + } + 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; + 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 + */ + + /** + * 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 = ""; + + /** + * 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); + 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.charset = reader.string(); + break; + } + case 3: { + message.collation = reader.string(); + 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"; + 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"; + 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); + 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 = ""; + } + 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; + 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; + })(); + + 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|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|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|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 + */ + + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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.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) { + 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(); + 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.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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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) { + if (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; + + /** + * 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); + 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) { + 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(); + 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 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"; + 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); + 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.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 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.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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 + */ + + /** + * 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 = ""; + + /** + * 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); + 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.parent = 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 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"; + 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); + 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 = ""; + } + 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; + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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.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 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"|undefined} requestSpecific + * @memberof google.cloud.alloydb.v1beta.OperationMetadata + * @instance + */ + Object.defineProperty(OperationMetadata.prototype, "requestSpecific", { + get: $util.oneOfGetter($oneOfFields = ["batchCreateInstancesMetadata"]), + 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(); + 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) { + 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(); + switch (tag >>> 3) { + case 8: { + message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.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.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.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"; + } + 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.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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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; + })(); + + 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.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) { + 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(); + 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; + })(); + + 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) { + 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(); + 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) { + 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(); + 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.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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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; + })(); + + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * 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.fieldInfo. + * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldInfo"] = null; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = 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) { + 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(); + 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 291403980: { + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.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.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; + } + 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; + } + 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.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"]); + } + 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"]); + } + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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 = {}; + + /** + * 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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) { + 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(); + 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/v1beta/protos/protos.json b/owl-bot-staging/google-cloud-alloydb/v1beta/protos/protos.json new file mode 100644 index 00000000000..ce207332807 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/protos/protos.json @@ -0,0 +1,5788 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "alloydb": { + "nested": { + "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": "ServiceProto", + "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/Network", + "(google.api.resource_definition).pattern": "projects/{project}/global/networks/{network}" + }, + "nested": { + "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 + } + }, + "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 + } + } + }, + "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 + } + }, + "nested": { + "MaintenanceWindow": { + "fields": { + "day": { + "type": "google.type.DayOfWeek", + "id": 1 + }, + "startTime": { + "type": "google.type.TimeOfDay", + "id": 2 + } + } + } + } + }, + "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).style": "DECLARATIVE_FRIENDLY" + }, + "oneofs": { + "source": { + "oneof": [ + "backupSource", + "migrationSource" + ] + } + }, + "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" + } + }, + "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" + } + }, + "maintenanceUpdatePolicy": { + "type": "MaintenanceUpdatePolicy", + "id": 32, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maintenanceSchedule": { + "type": "MaintenanceSchedule", + "id": 37, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "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 + } + } + }, + "PrimaryConfig": { + "fields": { + "secondaryClusterNames": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "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).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 + }, + "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" + } + }, + "outboundPublicIpAddresses": { + "rule": "repeated", + "type": "string", + "id": 34, + "options": { + "(google.api.field_info).format": "IPV4", + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "MachineConfig": { + "fields": { + "cpuCount": { + "type": "int32", + "id": 1 + } + } + }, + "Node": { + "fields": { + "zoneId": { + "type": "string", + "id": 1 + }, + "id": { + "type": "string", + "id": 2 + }, + "ip": { + "type": "string", + "id": 3 + }, + "state": { + "type": "string", + "id": 4 + } + } + }, + "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 + } + } + } + }, + "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": { + "consumerEndpointIps": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "networkAttachment": { + "type": "string", + "id": 2 + } + } + }, + "PscInstanceConfig": { + "fields": { + "serviceAttachmentLink": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "allowedConsumerProjects": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowedConsumerNetworks": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pscInterfaceConfigs": { + "rule": "repeated", + "type": "PscInterfaceConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outgoingServiceAttachmentLinks": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pscEnabled": { + "type": "bool", + "id": 6, + "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" + } + } + }, + "nested": { + "AuthorizedNetwork": { + "fields": { + "cidrRange": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_info).format": "IPV4" + } + } + } + } + } + }, + "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 + } + } + } + }, + "ConnectionInfo": { + "options": { + "(google.api.resource).type": "alloydb.googleapis.com/ConnectionInfo", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/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).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" + } + }, + "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" + } + } + }, + "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}" + }, + "oneofs": { + "restrictions": { + "oneof": [ + "stringRestrictions", + "integerRestrictions" + ] + } + }, + "fields": { + "stringRestrictions": { + "type": "StringRestrictions", + "id": 7 + }, + "integerRestrictions": { + "type": "IntegerRestrictions", + "id": 8 + }, + "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 + } + }, + "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 + } + } + } + }, + "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).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" + } + } + }, + "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" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "charset": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "collation": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "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" + } + } + ] + }, + "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" + } + } + ] + }, + "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" + } + } + ] + }, + "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" + } + ] + } + } + }, + "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" + } + } + } + }, + "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" + } + } + } + }, + "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" + } + } + } + }, + "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 + } + } + }, + "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" + ] + } + }, + "fields": { + "batchCreateInstancesMetadata": { + "type": "BatchCreateInstancesMetadata", + "id": 8, + "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" + } + } + } + }, + "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 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api;api", + "java_multiple_files": true, + "java_outer_classname": "LaunchStageProto", + "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 + } + }, + "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 + } + } + } + }, + "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 + } + } + }, + "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 + } + } + } + }, + "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": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "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": { + "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, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "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": { + "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": { + "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": { + "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": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "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": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "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": { + "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": { + "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": { + "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, + "options": { + "packed": false + } + }, + "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": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "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": { + "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": { + "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": { + "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": { + "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": { + "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": { + "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": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "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": { + "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", + "cc_enable_arenas": true + }, + "nested": { + "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/v1beta/samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js new file mode 100644 index 00000000000..d8fc36d7f61 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js @@ -0,0 +1,81 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_backup.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_backup.js new file mode 100644 index 00000000000..bfd84364aa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_backup.js @@ -0,0 +1,91 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js new file mode 100644 index 00000000000..774bf1e618c --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js @@ -0,0 +1,93 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating 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 (e.g. permission checks and + * any other type of validation), but do 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_instance.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_instance.js new file mode 100644 index 00000000000..485bab7b525 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_instance.js @@ -0,0 +1,93 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating 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 (e.g. permission checks and + * any other type of validation), but do 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js new file mode 100644 index 00000000000..7798f3fd61e --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js @@ -0,0 +1,93 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating 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 (e.g. permission checks and + * any other type of validation), but do 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js new file mode 100644 index 00000000000..b0a62b0c791 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js @@ -0,0 +1,93 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating 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 (e.g. permission checks and + * any other type of validation), but do 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_user.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_user.js new file mode 100644 index 00000000000..dee7285ec6f --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_user.js @@ -0,0 +1,90 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_backup.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_backup.js new file mode 100644 index 00000000000..e90e06eb231 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_backup.js @@ -0,0 +1,88 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js new file mode 100644 index 00000000000..5339ccaf0cd --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js @@ -0,0 +1,92 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // 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 (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + */ + // 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_instance.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_instance.js new file mode 100644 index 00000000000..d08ed5167f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_instance.js @@ -0,0 +1,88 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // 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 (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + */ + // 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_user.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_user.js new file mode 100644 index 00000000000..4d582ae4f05 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_user.js @@ -0,0 +1,81 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.failover_instance.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.failover_instance.js new file mode 100644 index 00000000000..63fd0ce8860 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.failover_instance.js @@ -0,0 +1,82 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the failover. + */ + // 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js new file mode 100644 index 00000000000..c4793d7945a --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js @@ -0,0 +1,99 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // 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 + * ceritificate 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_backup.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_backup.js new file mode 100644 index 00000000000..4e313ddd5ac --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_backup.js @@ -0,0 +1,61 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js new file mode 100644 index 00000000000..9bb9eea3641 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js @@ -0,0 +1,67 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js new file mode 100644 index 00000000000..8fb8d256642 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js @@ -0,0 +1,76 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_instance.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_instance.js new file mode 100644 index 00000000000..247327798bb --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_instance.js @@ -0,0 +1,66 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_user.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_user.js new file mode 100644 index 00000000000..52d285c62e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_user.js @@ -0,0 +1,62 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js new file mode 100644 index 00000000000..97a83843d6f --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js @@ -0,0 +1,88 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the fault + * injection. + */ + // 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_backups.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_backups.js new file mode 100644 index 00000000000..4e614c2c99e --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_backups.js @@ -0,0 +1,80 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_clusters.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_clusters.js new file mode 100644 index 00000000000..6911145b5ff --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_clusters.js @@ -0,0 +1,83 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_databases.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_databases.js new file mode 100644 index 00000000000..8b4761f54dd --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_databases.js @@ -0,0 +1,81 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, an appropriate number of databases + * will be returned. The max value will be 2000, 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_instances.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_instances.js new file mode 100644 index 00000000000..7a036b4ab31 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_instances.js @@ -0,0 +1,85 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js new file mode 100644 index 00000000000..faf32726570 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js @@ -0,0 +1,77 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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' + + // 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_users.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_users.js new file mode 100644 index 00000000000..cb4109d0019 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_users.js @@ -0,0 +1,80 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js new file mode 100644 index 00000000000..2cc0403f4da --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js @@ -0,0 +1,88 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // 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 (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + */ + // 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.restart_instance.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.restart_instance.js new file mode 100644 index 00000000000..a90610044b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.restart_instance.js @@ -0,0 +1,82 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the restart. + */ + // const validateOnly = true + + // 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js new file mode 100644 index 00000000000..d8a544f72b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js @@ -0,0 +1,102 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating 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 (e.g. permission checks and + * any other type of validation), but do not actually execute the import + * 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_backup.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_backup.js new file mode 100644 index 00000000000..c4a40d59cda --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_backup.js @@ -0,0 +1,94 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_cluster.js new file mode 100644 index 00000000000..af8fa63ca1c --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_cluster.js @@ -0,0 +1,95 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating 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 (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_instance.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_instance.js new file mode 100644 index 00000000000..214f5eaba46 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_instance.js @@ -0,0 +1,95 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating 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 (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_user.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_user.js new file mode 100644 index 00000000000..eab7e930b5a --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_user.js @@ -0,0 +1,92 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating 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/v1beta/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json new file mode 100644 index 00000000000..2318eab6e75 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json @@ -0,0 +1,1691 @@ +{ + "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_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": 84, + "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": 80, + "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_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": 80, + "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": 74, + "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": 74, + "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" + } + ], + "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_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": 69, + "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" + } + ], + "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" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/src/index.ts b/owl-bot-staging/google-cloud-alloydb/v1beta/src/index.ts new file mode 100644 index 00000000000..437f399a07e --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 v1beta from './v1beta'; +const AlloyDBAdminClient = v1beta.AlloyDBAdminClient; +type AlloyDBAdminClient = v1beta.AlloyDBAdminClient; +export {v1beta, AlloyDBAdminClient}; +export default {v1beta, AlloyDBAdminClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/alloy_d_b_admin_client.ts b/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/alloy_d_b_admin_client.ts new file mode 100644 index 00000000000..3b6f959d6d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/alloy_d_b_admin_client.ts @@ -0,0 +1,5218 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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'); + +/** + * 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; + 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://developers.google.com/identity/protocols/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.protobuf.Root.fromJSON(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 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 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)), + 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)), + 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', 'deleteCluster', 'promoteCluster', 'restoreCluster', 'createSecondaryCluster', 'listInstances', 'getInstance', 'createInstance', 'createSecondaryInstance', 'batchCreateInstances', 'updateInstance', 'deleteInstance', 'failoverInstance', 'injectFault', 'restartInstance', '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.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(); + return this.innerApiCalls.getCluster(request, options, callback); + } +/** + * 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(); + return this.innerApiCalls.getInstance(request, options, callback); + } +/** + * 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(); + return this.innerApiCalls.getBackup(request, options, callback); + } +/** + * 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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 + * ceritificate 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(); + return this.innerApiCalls.generateClientCertificate(request, options, callback); + } +/** + * 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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(); + return this.innerApiCalls.getConnectionInfo(request, options, callback); + } +/** + * 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(); + return this.innerApiCalls.getUser(request, options, callback); + } +/** + * 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate 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(); + return this.innerApiCalls.createUser(request, options, callback); + } +/** + * 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate 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(); + return this.innerApiCalls.updateUser(request, options, callback); + } +/** + * 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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(); + return this.innerApiCalls.deleteUser(request, options, callback); + } + +/** + * 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate 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 (e.g. permission checks and + * any other type of validation), but do 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(); + return this.innerApiCalls.createCluster(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate 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 (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * 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(); + return this.innerApiCalls.updateCluster(request, options, callback); + } +/** + * 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>{ + 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; + } +/** + * 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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 (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * @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(); + return this.innerApiCalls.deleteCluster(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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 (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * @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(); + return this.innerApiCalls.promoteCluster(request, options, callback); + } +/** + * 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>{ + 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; + } +/** + * 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate 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 (e.g. permission checks and + * any other type of validation), but do not actually execute the import + * 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(); + return this.innerApiCalls.restoreCluster(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate 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 (e.g. permission checks and + * any other type of validation), but do 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(); + return this.innerApiCalls.createSecondaryCluster(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate 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 (e.g. permission checks and + * any other type of validation), but do 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(); + return this.innerApiCalls.createInstance(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate 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 (e.g. permission checks and + * any other type of validation), but do 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(); + return this.innerApiCalls.createSecondaryInstance(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate 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(); + return this.innerApiCalls.batchCreateInstances(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate 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 (e.g. permission checks and + * any other type of validation), but do not actually execute the update + * 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(); + return this.innerApiCalls.updateInstance(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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 (e.g. permission checks and + * any other type of validation), but do not actually execute the delete. + * @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(); + return this.innerApiCalls.deleteInstance(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the failover. + * @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(); + return this.innerApiCalls.failoverInstance(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the fault + * injection. + * @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(); + return this.innerApiCalls.injectFault(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. If set, performs request validation (e.g. permission checks and + * any other type of validation), but do not actually execute the restart. + * @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(); + return this.innerApiCalls.restartInstance(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate 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(); + return this.innerApiCalls.createBackup(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate 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(); + return this.innerApiCalls.updateBackup(request, options, callback); + } +/** + * 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>{ + 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 will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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(); + return this.innerApiCalls.deleteBackup(request, options, callback); + } +/** + * 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>{ + 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(); + return this.innerApiCalls.listClusters(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, 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(); + 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(); + 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(); + return this.innerApiCalls.listInstances(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, 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(); + 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(); + 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(); + return this.innerApiCalls.listBackups(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, 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(); + 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(); + 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 {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(); + return this.innerApiCalls.listSupportedDatabaseFlags(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, 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 {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(); + 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 {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(); + 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(); + return this.innerApiCalls.listUsers(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, 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(); + 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(); + 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, an appropriate number of databases + * will be returned. The max value will be 2000, 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(); + return this.innerApiCalls.listDatabases(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, 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, an appropriate number of databases + * will be returned. The max value will be 2000, 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(); + 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, an appropriate number of databases + * will be returned. The max value will be 2000, 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(); + 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, + options?: + | 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]> { + 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 { + 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, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + 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, + options?: + | 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 { + 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._terminated = true; + stub.close(); + this.iamClient.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/alloy_d_b_admin_client_config.json b/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/alloy_d_b_admin_client_config.json new file mode 100644 index 00000000000..b415f7b4a5a --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/alloy_d_b_admin_client_config.json @@ -0,0 +1,198 @@ +{ + "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" + }, + "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" + }, + "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" + }, + "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" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/alloy_d_b_admin_proto_list.json b/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/alloy_d_b_admin_proto_list.json new file mode 100644 index 00000000000..301a66f45b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/alloy_d_b_admin_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/cloud/alloydb/v1beta/resources.proto", + "../../protos/google/cloud/alloydb/v1beta/service.proto" +] diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/gapic_metadata.json b/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/gapic_metadata.json new file mode 100644 index 00000000000..8392ceb7a1c --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/gapic_metadata.json @@ -0,0 +1,367 @@ +{ + "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" + ] + }, + "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" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "PromoteCluster": { + "methods": [ + "promoteCluster" + ] + }, + "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" + ] + }, + "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" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "PromoteCluster": { + "methods": [ + "promoteCluster" + ] + }, + "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" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/index.ts b/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/index.ts new file mode 100644 index 00000000000..93eec87dc06 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/index.ts @@ -0,0 +1,19 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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'; diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-alloydb/v1beta/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..f26aa8e2c06 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-alloydb/v1beta/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..bd7a760f403 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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} from '@google-cloud/alloydb'; + +// check that the client class type name can be used +function doStuffWithAlloyDBAdminClient(client: AlloyDBAdminClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const alloyDBAdminClient = new AlloyDBAdminClient(); + doStuffWithAlloyDBAdminClient(alloyDBAdminClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/system-test/install.ts b/owl-bot-staging/google-cloud-alloydb/v1beta/system-test/install.ts new file mode 100644 index 00000000000..fd5bfdc71d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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/v1beta/test/gapic_alloy_d_b_admin_v1beta.ts b/owl-bot-staging/google-cloud-alloydb/v1beta/test/gapic_alloy_d_b_admin_v1beta.ts new file mode 100644 index 00000000000..1391ba3892c --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/test/gapic_alloy_d_b_admin_v1beta.ts @@ -0,0 +1,6475 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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(); + assert(client.alloyDBAdminStub); + client.close().then(() => { + done(); + }); + }); + + 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(); + }); + }); + + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + await assert.rejects(client.getInstance(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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + await assert.rejects(client.deleteUser(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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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('deleteCluster', () => { + it('invokes deleteCluster without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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('restoreCluster', () => { + it('invokes restoreCluster without error', async () => { + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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); + } + }); + }); + 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', + }); + 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', + }); + 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', + }); + 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); + } + }); + }); + 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', + }); + 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', + }); + 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', + }); + 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); + } + }); + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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); + } + }); + }); + 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', + }); + 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); + } + }); + }); + 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', + }); + 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); + } + }); + }); + 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.ListOperationsResponse[] = []; + 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', + }); + 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.ListOperationsResponse[] = []; + 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', () => { + 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', + }); + 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', () => { + 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', + }); + 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', () => { + 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', + }); + 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', () => { + 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', + }); + 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', () => { + 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', + }); + 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', () => { + 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', + }); + 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', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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', () => { + 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', + }); + 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', () => { + 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', + }); + 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/v1beta/tsconfig.json b/owl-bot-staging/google-cloud-alloydb/v1beta/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/webpack.config.js b/owl-bot-staging/google-cloud-alloydb/v1beta/webpack.config.js new file mode 100644 index 00000000000..ee88fe6afc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-alloydb/v1beta/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 eea9f15b49e3c74c2c4e9a81ce0353b8d550a92e Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 22 Oct 2024 17:14:19 +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/v1/.eslintignore | 7 - .../google-cloud-alloydb/v1/.eslintrc.json | 3 - .../google-cloud-alloydb/v1/.gitignore | 14 - .../google-cloud-alloydb/v1/.jsdoc.js | 55 - .../google-cloud-alloydb/v1/.mocharc.js | 33 - .../google-cloud-alloydb/v1/.prettierrc.js | 22 - .../google-cloud-alloydb/v1/README.md | 1 - .../google-cloud-alloydb/v1/package.json | 58 - .../google/cloud/alloydb/v1/resources.proto | 1407 - .../google/cloud/alloydb/v1/service.proto | 1784 - .../v1/protos/protos.d.ts | 20386 ------ .../google-cloud-alloydb/v1/protos/protos.js | 52585 ---------------- .../v1/protos/protos.json | 6030 -- .../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.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.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_instances.js | 85 - ...d_b_admin.list_supported_database_flags.js | 77 - .../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.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 - ...ppet_metadata_google.cloud.alloydb.v1.json | 1795 - .../google-cloud-alloydb/v1/src/index.ts | 25 - .../v1/src/v1/alloy_d_b_admin_client.ts | 5425 -- .../src/v1/alloy_d_b_admin_client_config.json | 208 - .../v1/src/v1/alloy_d_b_admin_proto_list.json | 5 - .../v1/src/v1/gapic_metadata.json | 387 - .../google-cloud-alloydb/v1/src/v1/index.ts | 19 - .../system-test/fixtures/sample/src/index.js | 27 - .../system-test/fixtures/sample/src/index.ts | 32 - .../v1/system-test/install.ts | 49 - .../v1/test/gapic_alloy_d_b_admin_v1.ts | 6737 -- .../google-cloud-alloydb/v1/tsconfig.json | 19 - .../google-cloud-alloydb/v1/webpack.config.js | 64 - .../v1alpha/.eslintignore | 7 - .../v1alpha/.eslintrc.json | 3 - .../google-cloud-alloydb/v1alpha/.gitignore | 14 - .../google-cloud-alloydb/v1alpha/.jsdoc.js | 55 - .../google-cloud-alloydb/v1alpha/.mocharc.js | 33 - .../v1alpha/.prettierrc.js | 22 - .../google-cloud-alloydb/v1alpha/README.md | 1 - .../google-cloud-alloydb/v1alpha/package.json | 58 - .../cloud/alloydb/v1alpha/resources.proto | 1356 - .../cloud/alloydb/v1alpha/service.proto | 1641 - .../v1alpha/protos/protos.d.ts | 19263 ------ .../v1alpha/protos/protos.js | 49802 --------------- .../v1alpha/protos/protos.json | 5762 -- .../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_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 | 92 - .../alloy_d_b_admin.delete_instance.js | 88 - .../v1alpha/alloy_d_b_admin.delete_user.js | 81 - .../alloy_d_b_admin.failover_instance.js | 82 - ...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.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 | 77 - .../v1alpha/alloy_d_b_admin.list_users.js | 80 - .../alloy_d_b_admin.promote_cluster.js | 88 - .../alloy_d_b_admin.restart_instance.js | 82 - .../alloy_d_b_admin.restore_cluster.js | 102 - .../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 - ...metadata_google.cloud.alloydb.v1alpha.json | 1691 - .../google-cloud-alloydb/v1alpha/src/index.ts | 25 - .../src/v1alpha/alloy_d_b_admin_client.ts | 5218 -- .../alloy_d_b_admin_client_config.json | 198 - .../v1alpha/alloy_d_b_admin_proto_list.json | 4 - .../v1alpha/src/v1alpha/gapic_metadata.json | 367 - .../v1alpha/src/v1alpha/index.ts | 19 - .../system-test/fixtures/sample/src/index.js | 27 - .../system-test/fixtures/sample/src/index.ts | 32 - .../v1alpha/system-test/install.ts | 49 - .../test/gapic_alloy_d_b_admin_v1alpha.ts | 6475 -- .../v1alpha/tsconfig.json | 19 - .../v1alpha/webpack.config.js | 64 - .../google-cloud-alloydb/v1beta/.eslintignore | 7 - .../v1beta/.eslintrc.json | 3 - .../google-cloud-alloydb/v1beta/.gitignore | 14 - .../google-cloud-alloydb/v1beta/.jsdoc.js | 55 - .../google-cloud-alloydb/v1beta/.mocharc.js | 33 - .../v1beta/.prettierrc.js | 22 - .../google-cloud-alloydb/v1beta/README.md | 1 - .../google-cloud-alloydb/v1beta/package.json | 58 - .../cloud/alloydb/v1beta/resources.proto | 1386 - .../google/cloud/alloydb/v1beta/service.proto | 1641 - .../v1beta/protos/protos.d.ts | 19466 ------ .../v1beta/protos/protos.js | 50335 --------------- .../v1beta/protos/protos.json | 5788 -- .../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_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 | 92 - .../v1beta/alloy_d_b_admin.delete_instance.js | 88 - .../v1beta/alloy_d_b_admin.delete_user.js | 81 - .../alloy_d_b_admin.failover_instance.js | 82 - ...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.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 | 77 - .../v1beta/alloy_d_b_admin.list_users.js | 80 - .../v1beta/alloy_d_b_admin.promote_cluster.js | 88 - .../alloy_d_b_admin.restart_instance.js | 82 - .../v1beta/alloy_d_b_admin.restore_cluster.js | 102 - .../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 - ..._metadata_google.cloud.alloydb.v1beta.json | 1691 - .../google-cloud-alloydb/v1beta/src/index.ts | 25 - .../src/v1beta/alloy_d_b_admin_client.ts | 5218 -- .../v1beta/alloy_d_b_admin_client_config.json | 198 - .../v1beta/alloy_d_b_admin_proto_list.json | 4 - .../v1beta/src/v1beta/gapic_metadata.json | 367 - .../v1beta/src/v1beta/index.ts | 19 - .../system-test/fixtures/sample/src/index.js | 27 - .../system-test/fixtures/sample/src/index.ts | 32 - .../v1beta/system-test/install.ts | 49 - .../test/gapic_alloy_d_b_admin_v1beta.ts | 6475 -- .../google-cloud-alloydb/v1beta/tsconfig.json | 19 - .../v1beta/webpack.config.js | 64 - packages/google-cloud-alloydb/README.md | 7 +- .../google/cloud/alloydb/v1/data_model.proto | 0 .../google/cloud/alloydb/v1/resources.proto | 251 +- .../google/cloud/alloydb/v1/service.proto | 482 +- .../google-cloud-alloydb/protos/protos.d.ts | 2431 +- .../google-cloud-alloydb/protos/protos.js | 22052 ++++--- .../google-cloud-alloydb/protos/protos.json | 665 +- .../google-cloud-alloydb/samples/README.md | 54 + .../alloy_d_b_admin.batch_create_instances.js | 10 +- .../v1/alloy_d_b_admin.create_backup.js | 10 +- .../v1/alloy_d_b_admin.create_cluster.js | 16 +- .../v1/alloy_d_b_admin.create_instance.js | 16 +- ...lloy_d_b_admin.create_secondary_cluster.js | 16 +- ...loy_d_b_admin.create_secondary_instance.js | 16 +- .../v1/alloy_d_b_admin.create_user.js | 10 +- .../v1/alloy_d_b_admin.delete_backup.js | 10 +- .../v1/alloy_d_b_admin.delete_cluster.js | 15 +- .../v1/alloy_d_b_admin.delete_instance.js | 15 +- .../v1/alloy_d_b_admin.delete_user.js | 10 +- .../v1/alloy_d_b_admin.execute_sql.js | 0 .../v1/alloy_d_b_admin.failover_instance.js | 15 +- ...y_d_b_admin.generate_client_certificate.js | 10 +- .../v1/alloy_d_b_admin.get_connection_info.js | 10 +- .../v1/alloy_d_b_admin.inject_fault.js | 16 +- .../v1/alloy_d_b_admin.list_databases.js | 0 .../v1/alloy_d_b_admin.promote_cluster.js | 11 +- .../v1/alloy_d_b_admin.restart_instance.js | 20 +- .../v1/alloy_d_b_admin.restore_cluster.js | 16 +- .../v1/alloy_d_b_admin.switchover_cluster.js | 0 .../v1/alloy_d_b_admin.update_backup.js | 10 +- .../v1/alloy_d_b_admin.update_cluster.js | 16 +- .../v1/alloy_d_b_admin.update_instance.js | 16 +- .../v1/alloy_d_b_admin.update_user.js | 10 +- ...ppet_metadata_google.cloud.alloydb.v1.json | 170 +- .../src/v1/alloy_d_b_admin_client.ts | 838 +- .../src/v1/alloy_d_b_admin_client_config.json | 15 + .../src/v1/alloy_d_b_admin_proto_list.json | 1 + .../src/v1/gapic_metadata.json | 34 + .../test/gapic_alloy_d_b_admin_v1.ts | 709 +- 212 files changed, 19159 insertions(+), 299301 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/.prettierrc.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/README.md delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/package.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/protos/google/cloud/alloydb/v1/resources.proto delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/protos/google/cloud/alloydb/v1/service.proto delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/protos/protos.d.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/protos/protos.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/protos/protos.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_backup.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_user.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.delete_backup.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.delete_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.delete_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.delete_user.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.failover_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_backup.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_connection_info.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_user.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.inject_fault.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_backups.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_clusters.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_instances.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_users.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.promote_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.restart_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.restore_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.update_backup.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.update_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.update_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.update_user.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/src/v1/alloy_d_b_admin_client.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/src/v1/alloy_d_b_admin_client_config.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/src/v1/alloy_d_b_admin_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/src/v1/index.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/test/gapic_alloy_d_b_admin_v1.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1/webpack.config.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/.gitignore delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/.prettierrc.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/README.md delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/package.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/protos/google/cloud/alloydb/v1alpha/resources.proto delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/protos/google/cloud/alloydb/v1alpha/service.proto delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/protos/protos.d.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/protos/protos.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/protos/protos.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_backup.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_user.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_backup.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_user.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_backups.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_databases.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_instances.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_users.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_backup.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_user.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/alloy_d_b_admin_client.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/alloy_d_b_admin_client_config.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/alloy_d_b_admin_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/index.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/test/gapic_alloy_d_b_admin_v1alpha.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1alpha/webpack.config.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/.gitignore delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/.prettierrc.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/README.md delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/package.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/protos/google/cloud/alloydb/v1beta/resources.proto delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/protos/google/cloud/alloydb/v1beta/service.proto delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/protos/protos.d.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/protos/protos.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/protos/protos.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_backup.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_user.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_backup.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_user.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.failover_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_backup.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_user.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_backups.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_clusters.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_databases.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_instances.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_users.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.restart_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_backup.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_cluster.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_instance.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_user.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/alloy_d_b_admin_client.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/alloy_d_b_admin_client_config.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/alloy_d_b_admin_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/index.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/test/gapic_alloy_d_b_admin_v1beta.ts delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-alloydb/v1beta/webpack.config.js rename {owl-bot-staging/google-cloud-alloydb/v1 => packages/google-cloud-alloydb}/protos/google/cloud/alloydb/v1/data_model.proto (100%) rename {owl-bot-staging/google-cloud-alloydb/v1 => packages/google-cloud-alloydb}/samples/generated/v1/alloy_d_b_admin.execute_sql.js (100%) rename {owl-bot-staging/google-cloud-alloydb/v1 => packages/google-cloud-alloydb}/samples/generated/v1/alloy_d_b_admin.list_databases.js (100%) rename {owl-bot-staging/google-cloud-alloydb/v1 => packages/google-cloud-alloydb}/samples/generated/v1/alloy_d_b_admin.switchover_cluster.js (100%) diff --git a/owl-bot-staging/google-cloud-alloydb/v1/.eslintignore b/owl-bot-staging/google-cloud-alloydb/v1/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/.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/v1/.eslintrc.json b/owl-bot-staging/google-cloud-alloydb/v1/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-cloud-alloydb/v1/.gitignore b/owl-bot-staging/google-cloud-alloydb/v1/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/.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/v1/.jsdoc.js b/owl-bot-staging/google-cloud-alloydb/v1/.jsdoc.js deleted file mode 100644 index 6c10f22a83a..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 2024 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/v1/.mocharc.js b/owl-bot-staging/google-cloud-alloydb/v1/.mocharc.js deleted file mode 100644 index 13b67c34edc..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/.prettierrc.js b/owl-bot-staging/google-cloud-alloydb/v1/.prettierrc.js deleted file mode 100644 index 9a8fd690982..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/README.md b/owl-bot-staging/google-cloud-alloydb/v1/README.md deleted file mode 100644 index 433e5333737..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/README.md +++ /dev/null @@ -1 +0,0 @@ -Alloydb: Nodejs Client diff --git a/owl-bot-staging/google-cloud-alloydb/v1/package.json b/owl-bot-staging/google-cloud-alloydb/v1/package.json deleted file mode 100644 index 7d0d731ff2e..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "@google-cloud/alloydb", - "version": "0.1.0", - "description": "Alloydb client for Node.js", - "repository": "googleapis/nodejs-alloydb", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google alloydb", - "alloydb", - "alloy d b admin" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^4.3.4" - }, - "devDependencies": { - "@types/mocha": "^10.0.6", - "@types/node": "^20.12.12", - "@types/sinon": "^10.0.20", - "c8": "^9.1.0", - "gapic-tools": "^0.4.2", - "gts": "5.3.0", - "jsdoc": "^4.0.3", - "jsdoc-fresh": "^3.0.0", - "jsdoc-region-tag": "^3.0.0", - "mocha": "^10.4.0", - "pack-n-play": "^2.0.3", - "sinon": "^15.2.0", - "typescript": "5.1.6" - }, - "engines": { - "node": ">=v14" - } -} diff --git a/owl-bot-staging/google-cloud-alloydb/v1/protos/google/cloud/alloydb/v1/resources.proto b/owl-bot-staging/google-cloud-alloydb/v1/protos/google/cloud/alloydb/v1/resources.proto deleted file mode 100644 index 424baceef22..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/protos/google/cloud/alloydb/v1/resources.proto +++ /dev/null @@ -1,1407 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.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}" -}; - -// 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; -} - -// 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; -} - -// 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 then use default encryption scheme to - // protect the user data. - 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 then use default encryption scheme to - // protect the user data. - 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. Output - // only field. Ignored if passed into the request. - repeated google.type.DayOfWeek schedule = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The earliest restorable time that can be restored to. Output - // only field. - 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; - } - - // Preferred windows to perform maintenance. Currently limited to 1. - repeated MaintenanceWindow maintenance_windows = 1; -} - -// 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; - } - - // 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]; - } - - // 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]; - } - - // 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; - } - - // Cluster State - enum State { - // The state of the cluster is unknown. - STATE_UNSPECIFIED = 0; - - // The cluster is active and running. - READY = 1; - - // The cluster is stopped. All instances in the cluster are stopped. - // Customers can start a stopped cluster at any point and all their - // instances will come back to life with same names and IP resources. In - // this state, customer pays for storage. - // Associated backups could also be present in a stopped cluster. - 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. 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. 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 - ]; -} - -// 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; - } - - // Details of a single node in the instance. - // Nodes in an AlloyDB instance are ephemereal, they can change during - // update, failover, autohealing and resize operations. - message Node { - // The Compute Engine zone of the VM e.g. "us-central1-b". - string zone_id = 1; - - // The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". - string id = 2; - - // The private IP address of the VM e.g. "10.57.0.34". - string ip = 3; - - // 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; - } - - // 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; - } - - // 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]; - } - - // 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]; - - // 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]; - } - - // 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]; - } - - // 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; - } - - // 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 instance level. - // * They are copied from primary instance on read instance creation. - // * Read instances can set new or override existing flags that are relevant - // for reads, e.g. for enabling columnar cache on a read instance. Flags - // set on read instance may or may not be present on primary. - // - // - // 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; - - // 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 - ]; -} - -// 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 - 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]; - - // 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 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 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; -} - -// 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. 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]; - - // Optional. Collation for the database. - // Name of the custom or native collation for postgres. - // Example values include "C", "POSIX", etc - string collation = 3 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-alloydb/v1/protos/google/cloud/alloydb/v1/service.proto b/owl-bot-staging/google-cloud-alloydb/v1/protos/google/cloud/alloydb/v1/service.proto deleted file mode 100644 index ab73dc5ccde..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/protos/google/cloud/alloydb/v1/service.proto +++ /dev/null @@ -1,1784 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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" - }; - } - - // 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]; -} - -// 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. -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]; -} - -// 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; -} - -// 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 - // ceritificate 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. 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 [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 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 requesting list of Databases. -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 response to listing Databases. -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/v1/protos/protos.d.ts b/owl-bot-staging/google-cloud-alloydb/v1/protos/protos.d.ts deleted file mode 100644 index ade429a820a..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/protos/protos.d.ts +++ /dev/null @@ -1,20386 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 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); - - /** SqlResultValue _value. */ - public _value?: "value"; - - /** SqlResultValue _nullValue. */ - public _nullValue?: "nullValue"; - - /** - * 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; - } - - /** 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 - } - - /** 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"); - - /** AutomatedBackupPolicy _enabled. */ - public _enabled?: "enabled"; - - /** - * 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); - - /** ContinuousBackupConfig _enabled. */ - public _enabled?: "enabled"; - - /** - * 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); - } - - /** 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[]; - - /** - * 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 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 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); - } - - /** 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 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 source. */ - public source?: ("backupSource"|"migrationSource"); - - /** - * 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); - } - - /** 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; - - /** - * 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; - } - - /** 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 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); - } - - /** 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 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[]; - - /** - * 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); - } - - /** 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; - - /** - * 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); - - /** QueryInsightsInstanceConfig _recordApplicationTags. */ - public _recordApplicationTags?: "recordApplicationTags"; - - /** QueryInsightsInstanceConfig _recordClientAddress. */ - public _recordClientAddress?: "recordClientAddress"; - - /** QueryInsightsInstanceConfig _queryPlansPerMinute. */ - public _queryPlansPerMinute?: "queryPlansPerMinute"; - - /** - * 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 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 PscInstanceConfig. */ - interface IPscInstanceConfig { - - /** PscInstanceConfig serviceAttachmentLink */ - serviceAttachmentLink?: (string|null); - - /** PscInstanceConfig allowedConsumerProjects */ - allowedConsumerProjects?: (string[]|null); - - /** PscInstanceConfig pscDnsName */ - pscDnsName?: (string|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; - - /** - * 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); - } - - /** 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; - - /** - * 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; - } - } - - /** 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 - } - } - - /** 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 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 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 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); - } - - /** 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 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 restrictions. */ - public restrictions?: ("stringRestrictions"|"integerRestrictions"); - - /** - * 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 - } - } - - /** 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); - } - - /** 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; - - /** - * 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 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|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 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); - } - - /** 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 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); - } - - /** 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; - - /** - * 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 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 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"; - - /** - * 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 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; - } - } - } - } - - /** 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 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 - } - } - - /** 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 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 - } - } - - /** 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.fieldInfo */ - ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); - - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|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|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|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|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|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|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|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 { - - /** 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/v1/protos/protos.js b/owl-bot-staging/google-cloud-alloydb/v1/protos/protos.js deleted file mode 100644 index 4379614337e..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/protos/protos.js +++ /dev/null @@ -1,52585 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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.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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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; - - /** - * SqlResultValue _value. - * @member {"value"|undefined} _value - * @memberof google.cloud.alloydb.v1.SqlResultValue - * @instance - */ - Object.defineProperty(SqlResultValue.prototype, "_value", { - get: $util.oneOfGetter($oneOfFields = ["value"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * SqlResultValue _nullValue. - * @member {"nullValue"|undefined} _nullValue - * @memberof google.cloud.alloydb.v1.SqlResultValue - * @instance - */ - 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) { - 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(); - 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; - })(); - - /** - * 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 - */ - 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; - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) - }); - - /** - * AutomatedBackupPolicy _enabled. - * @member {"enabled"|undefined} _enabled - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @instance - */ - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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; - - /** - * ContinuousBackupConfig _enabled. - * @member {"enabled"|undefined} _enabled - * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig - * @instance - */ - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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 - */ - - /** - * 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 = []; - if (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; - - /** - * 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(); - 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) { - 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(); - 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; - } - 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; - } - } - 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]); - } - } - 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 = []; - 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); - } - 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) { - 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(); - 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; - })(); - - 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) { - 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(); - 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 {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 - */ - - /** - * 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 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; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Cluster source. - * @member {"backupSource"|"migrationSource"|undefined} source - * @memberof google.cloud.alloydb.v1.Cluster - * @instance - */ - Object.defineProperty(Cluster.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["backupSource", "migrationSource"]), - 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(); - 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) { - 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(); - 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 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; - } - 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.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: - 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"; - } - 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.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; - } - 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]]); - } - 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; - } - 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]]; - } - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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 - */ - - /** - * 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; - - /** - * 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); - 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.pscEnabled = reader.bool(); - 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"; - 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); - 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 (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) - object.pscEnabled = message.pscEnabled; - 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) { - 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(); - 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; - })(); - - /** - * 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.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 - */ - - /** - * 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 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; - - /** - * 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.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]); - 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) { - 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(); - 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 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; - } - 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.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"; - } - 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.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]); - } - 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.publicIpAddress = ""; - object.pscInstanceConfig = null; - object.networkConfig = 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.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]; - } - 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 - */ - - /** - * 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; - - /** - * 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); - 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.cpuCount = reader.int32(); - 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"; - 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; - 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; - if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) - object.cpuCount = message.cpuCount; - 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) { - 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(); - 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; - - /** - * QueryInsightsInstanceConfig _recordApplicationTags. - * @member {"recordApplicationTags"|undefined} _recordApplicationTags - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @instance - */ - Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordApplicationTags", { - get: $util.oneOfGetter($oneOfFields = ["recordApplicationTags"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * QueryInsightsInstanceConfig _recordClientAddress. - * @member {"recordClientAddress"|undefined} _recordClientAddress - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @instance - */ - Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordClientAddress", { - get: $util.oneOfGetter($oneOfFields = ["recordClientAddress"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * QueryInsightsInstanceConfig _queryPlansPerMinute. - * @member {"queryPlansPerMinute"|undefined} _queryPlansPerMinute - * @memberof google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig - * @instance - */ - 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) { - 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(); - 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.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) { - 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(); - 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) { - 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(); - 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.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 - */ - - /** - * 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 = []; - if (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 = ""; - - /** - * 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); - 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) { - 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(); - 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; - } - 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"; - 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); - 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 = []; - 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; - 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 - */ - - /** - * 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; - - /** - * 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); - 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) { - 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(); - 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; - } - 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"; - 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); - 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; - } - 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; - 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) { - 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(); - 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; - })(); - - /** - * 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; - })(); - - 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) { - 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(); - 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 {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 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(); - 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) { - 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(); - 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 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.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: - 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.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; - } - 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; - } - 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]]; - } - 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) { - 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(); - 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} [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 - */ - - /** - * 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 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; - - // 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) - }); - - /** - * 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(); - 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) { - 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(); - 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 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; - } - 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.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: - break; - } - } - if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) - if (typeof message.requiresDbRestart !== "boolean") - return "requiresDbRestart: boolean expected"; - 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.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; - } - } - if (object.requiresDbRestart != null) - message.requiresDbRestart = Boolean(object.requiresDbRestart); - 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; - } - 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"; - } - 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) { - 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(); - 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) { - 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(); - 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; - })(); - - 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) { - 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(); - 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 - */ - - /** - * 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 = ""; - - /** - * 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); - 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.charset = reader.string(); - break; - } - case 3: { - message.collation = reader.string(); - 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"; - 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"; - 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); - 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 = ""; - } - 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; - 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|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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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.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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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 - */ - - /** - * 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 = ""; - - // 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); - 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) { - 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(); - 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; - } - 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"; - 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); - 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 = ""; - } - 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"; - } - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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 - */ - - /** - * 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 = ""; - - /** - * 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); - 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.parent = 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 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"; - 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); - 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 = ""; - } - 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; - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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.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 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"|undefined} requestSpecific - * @memberof google.cloud.alloydb.v1.OperationMetadata - * @instance - */ - Object.defineProperty(OperationMetadata.prototype, "requestSpecific", { - get: $util.oneOfGetter($oneOfFields = ["batchCreateInstancesMetadata"]), - 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(); - 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) { - 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(); - switch (tag >>> 3) { - case 8: { - message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata.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.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.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"; - } - 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.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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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; - })(); - - return v1; - })(); - - 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.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) { - 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(); - 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; - })(); - - 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) { - 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(); - 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) { - 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(); - 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.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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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; - })(); - - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference - */ - - /** - * 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.fieldInfo. - * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldInfo"] = null; - - /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.resourceReference"] = 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) { - 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(); - 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 291403980: { - message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); - break; - } - case 1055: { - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.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.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; - } - 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; - } - 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.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"]); - } - 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"]); - } - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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 = {}; - - /** - * 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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/v1/protos/protos.json b/owl-bot-staging/google-cloud-alloydb/v1/protos/protos.json deleted file mode 100644 index a7ebf57f6ce..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/protos/protos.json +++ /dev/null @@ -1,6030 +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": "ServiceProto", - "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/Network", - "(google.api.resource_definition).pattern": "projects/{project}/global/networks/{network}" - }, - "nested": { - "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 - } - } - } - }, - "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 - } - }, - "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 - } - } - }, - "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 - } - }, - "nested": { - "MaintenanceWindow": { - "fields": { - "day": { - "type": "google.type.DayOfWeek", - "id": 1 - }, - "startTime": { - "type": "google.type.TimeOfDay", - "id": 2 - } - } - } - } - }, - "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" - ] - } - }, - "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" - } - }, - "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" - } - } - }, - "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 - } - } - }, - "PrimaryConfig": { - "fields": { - "secondaryClusterNames": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "PscConfig": { - "fields": { - "pscEnabled": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "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 - } - } - }, - "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 - }, - "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" - } - } - }, - "nested": { - "MachineConfig": { - "fields": { - "cpuCount": { - "type": "int32", - "id": 1 - } - } - }, - "Node": { - "fields": { - "zoneId": { - "type": "string", - "id": 1 - }, - "id": { - "type": "string", - "id": 2 - }, - "ip": { - "type": "string", - "id": 3 - }, - "state": { - "type": "string", - "id": 4 - } - } - }, - "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 - } - } - } - }, - "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" - } - } - } - }, - "PscInstanceConfig": { - "fields": { - "serviceAttachmentLink": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "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" - } - } - } - }, - "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" - } - } - }, - "nested": { - "AuthorizedNetwork": { - "fields": { - "cidrRange": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_info).format": "IPV4" - } - } - } - } - } - }, - "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 - } - } - } - }, - "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" - } - }, - "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" - ] - } - }, - "fields": { - "stringRestrictions": { - "type": "StringRestrictions", - "id": 7 - }, - "integerRestrictions": { - "type": "IntegerRestrictions", - "id": 8 - }, - "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 - } - }, - "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 - } - } - } - }, - "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" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "charset": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "collation": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "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" - } - } - ] - }, - "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" - } - } - } - }, - "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" - } - } - } - }, - "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 - } - } - }, - "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" - ] - } - }, - "fields": { - "batchCreateInstancesMetadata": { - "type": "BatchCreateInstancesMetadata", - "id": 8, - "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" - } - } - } - }, - "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 - } - } - } - } - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api;api", - "java_multiple_files": true, - "java_outer_classname": "LaunchStageProto", - "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 - } - }, - "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 - } - } - } - }, - "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 - } - } - }, - "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 - } - } - } - }, - "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": { - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - } - }, - "Edition": { - "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": { - "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, - "options": { - "packed": false - } - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11, - "options": { - "packed": false - } - }, - "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": { - "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": { - "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": { - "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": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "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": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - } - }, - "MethodDescriptorProto": { - "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": { - "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": { - "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": { - "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, - "options": { - "packed": false - } - }, - "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": { - "fields": { - "features": { - "type": "FeatureSet", - "id": 1 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "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": { - "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": { - "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": { - "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": { - "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": { - "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": { - "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": { - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2 - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "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": { - "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", - "cc_enable_arenas": true - }, - "nested": { - "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/v1/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js deleted file mode 100644 index f4a949af133..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.create_backup.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_backup.js deleted file mode 100644 index 55f5bf8f3d7..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_backup.js +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.create_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_cluster.js deleted file mode 100644 index a476e312f50..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_cluster.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.create_instance.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_instance.js deleted file mode 100644 index a933aa9f7a3..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_instance.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js deleted file mode 100644 index 1163cebc496..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js deleted file mode 100644 index b0f338a53f6..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.create_user.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_user.js deleted file mode 100644 index d94d20fcb14..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.create_user.js +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.delete_backup.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.delete_backup.js deleted file mode 100644 index 30f51c39f28..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.delete_backup.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.delete_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.delete_cluster.js deleted file mode 100644 index 9d937d84ba9..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.delete_cluster.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.delete_instance.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.delete_instance.js deleted file mode 100644 index 811f1d0db5c..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.delete_instance.js +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.delete_user.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.delete_user.js deleted file mode 100644 index fe6477101ce..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.delete_user.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.failover_instance.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.failover_instance.js deleted file mode 100644 index bbfdd104ce8..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.failover_instance.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js deleted file mode 100644 index 3735a0ddac1..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 - * ceritificate 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/v1/samples/generated/v1/alloy_d_b_admin.get_backup.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_backup.js deleted file mode 100644 index a874b5e039c..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_backup.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.get_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_cluster.js deleted file mode 100644 index c26fff87612..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_cluster.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.get_connection_info.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_connection_info.js deleted file mode 100644 index e56f7efbcaf..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_connection_info.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.get_instance.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_instance.js deleted file mode 100644 index 6167195ca0a..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_instance.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.get_user.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_user.js deleted file mode 100644 index 33a8eb2d3a4..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.get_user.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.inject_fault.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.inject_fault.js deleted file mode 100644 index 78f96ef28e8..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.inject_fault.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.list_backups.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_backups.js deleted file mode 100644 index 4d8ac6bd6d8..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_backups.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.list_clusters.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_clusters.js deleted file mode 100644 index f887660681c..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_clusters.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.list_instances.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_instances.js deleted file mode 100644 index 120678beb7a..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_instances.js +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js deleted file mode 100644 index 18b1912620d..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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' - - // 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/v1/samples/generated/v1/alloy_d_b_admin.list_users.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_users.js deleted file mode 100644 index c2b9c8db326..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_users.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.promote_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.promote_cluster.js deleted file mode 100644 index 046405d4bae..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.promote_cluster.js +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.restart_instance.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.restart_instance.js deleted file mode 100644 index 2f5362f1a15..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.restart_instance.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.restore_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.restore_cluster.js deleted file mode 100644 index d5afe06e848..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.restore_cluster.js +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.update_backup.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.update_backup.js deleted file mode 100644 index ab87adf08c1..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.update_backup.js +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.update_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.update_cluster.js deleted file mode 100644 index b46d35b2a42..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.update_cluster.js +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.update_instance.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.update_instance.js deleted file mode 100644 index c1d663630f5..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.update_instance.js +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/alloy_d_b_admin.update_user.js b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.update_user.js deleted file mode 100644 index 7ffa0bed716..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.update_user.js +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json b/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json deleted file mode 100644 index f24834e655b..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json +++ /dev/null @@ -1,1795 +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_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": 78, - "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" - } - ], - "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": 69, - "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" - } - ], - "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" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-alloydb/v1/src/index.ts b/owl-bot-staging/google-cloud-alloydb/v1/src/index.ts deleted file mode 100644 index 0d58c12b9be..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 v1 from './v1'; -const AlloyDBAdminClient = v1.AlloyDBAdminClient; -type AlloyDBAdminClient = v1.AlloyDBAdminClient; -export {v1, AlloyDBAdminClient}; -export default {v1, AlloyDBAdminClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/google-cloud-alloydb/v1/src/v1/alloy_d_b_admin_client.ts b/owl-bot-staging/google-cloud-alloydb/v1/src/v1/alloy_d_b_admin_client.ts deleted file mode 100644 index 1acce893594..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/src/v1/alloy_d_b_admin_client.ts +++ /dev/null @@ -1,5425 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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'); - -/** - * 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; - 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://developers.google.com/identity/protocols/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.protobuf.Root.fromJSON(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 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)), - 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', '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(); - return this.innerApiCalls.getCluster(request, options, callback); - } -/** - * 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(); - return this.innerApiCalls.getInstance(request, options, callback); - } -/** - * 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 {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(); - return this.innerApiCalls.executeSql(request, options, callback); - } -/** - * 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(); - return this.innerApiCalls.getBackup(request, options, callback); - } -/** - * 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 - * ceritificate 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(); - return this.innerApiCalls.generateClientCertificate(request, options, callback); - } -/** - * 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(); - return this.innerApiCalls.getConnectionInfo(request, options, callback); - } -/** - * 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(); - return this.innerApiCalls.getUser(request, options, callback); - } -/** - * 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(); - return this.innerApiCalls.createUser(request, options, callback); - } -/** - * 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(); - return this.innerApiCalls.updateUser(request, options, callback); - } -/** - * 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(); - return this.innerApiCalls.deleteUser(request, options, callback); - } - -/** - * 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(); - return this.innerApiCalls.createCluster(request, options, callback); - } -/** - * 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>{ - 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(); - return this.innerApiCalls.updateCluster(request, options, callback); - } -/** - * 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>{ - 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; - } -/** - * 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(); - return this.innerApiCalls.deleteCluster(request, options, callback); - } -/** - * 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>{ - 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(); - return this.innerApiCalls.promoteCluster(request, options, callback); - } -/** - * 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>{ - 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(); - return this.innerApiCalls.switchoverCluster(request, options, callback); - } -/** - * 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>{ - 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(); - return this.innerApiCalls.restoreCluster(request, options, callback); - } -/** - * 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>{ - 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(); - return this.innerApiCalls.createSecondaryCluster(request, options, callback); - } -/** - * 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>{ - 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(); - return this.innerApiCalls.createInstance(request, options, callback); - } -/** - * 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>{ - 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(); - return this.innerApiCalls.createSecondaryInstance(request, options, callback); - } -/** - * 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>{ - 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(); - return this.innerApiCalls.batchCreateInstances(request, options, callback); - } -/** - * 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>{ - 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(); - return this.innerApiCalls.updateInstance(request, options, callback); - } -/** - * 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>{ - 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(); - return this.innerApiCalls.deleteInstance(request, options, callback); - } -/** - * 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>{ - 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(); - return this.innerApiCalls.failoverInstance(request, options, callback); - } -/** - * 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>{ - 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(); - return this.innerApiCalls.injectFault(request, options, callback); - } -/** - * 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>{ - 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(); - return this.innerApiCalls.restartInstance(request, options, callback); - } -/** - * 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>{ - 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(); - return this.innerApiCalls.createBackup(request, options, callback); - } -/** - * 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>{ - 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(); - return this.innerApiCalls.updateBackup(request, options, callback); - } -/** - * 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>{ - 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(); - return this.innerApiCalls.deleteBackup(request, options, callback); - } -/** - * 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>{ - 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(); - return this.innerApiCalls.listClusters(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, 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(); - 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(); - 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(); - return this.innerApiCalls.listInstances(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, 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(); - 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(); - 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(); - return this.innerApiCalls.listBackups(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, 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(); - 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(); - 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 {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(); - return this.innerApiCalls.listSupportedDatabaseFlags(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, 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 {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(); - 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 {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(); - 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(); - return this.innerApiCalls.listUsers(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, 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(); - 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(); - 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(); - return this.innerApiCalls.listDatabases(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, 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(); - 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(); - 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, - options?: - | 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]> { - 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 { - 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, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - 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, - options?: - | 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 { - 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._terminated = true; - stub.close(); - this.iamClient.close(); - this.locationsClient.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-alloydb/v1/src/v1/alloy_d_b_admin_client_config.json b/owl-bot-staging/google-cloud-alloydb/v1/src/v1/alloy_d_b_admin_client_config.json deleted file mode 100644 index a802cb3de79..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/src/v1/alloy_d_b_admin_client_config.json +++ /dev/null @@ -1,208 +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" - }, - "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/v1/src/v1/alloy_d_b_admin_proto_list.json b/owl-bot-staging/google-cloud-alloydb/v1/src/v1/alloy_d_b_admin_proto_list.json deleted file mode 100644 index b5e2e53d68c..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/src/v1/alloy_d_b_admin_proto_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "../../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/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-alloydb/v1/src/v1/gapic_metadata.json deleted file mode 100644 index 137fb3217d6..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/src/v1/gapic_metadata.json +++ /dev/null @@ -1,387 +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" - ] - }, - "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" - ] - }, - "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" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-alloydb/v1/src/v1/index.ts b/owl-bot-staging/google-cloud-alloydb/v1/src/v1/index.ts deleted file mode 100644 index 93eec87dc06..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/src/v1/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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'; diff --git a/owl-bot-staging/google-cloud-alloydb/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-alloydb/v1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index f26aa8e2c06..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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(); -} - -main(); diff --git a/owl-bot-staging/google-cloud-alloydb/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-alloydb/v1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index bd7a760f403..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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} from '@google-cloud/alloydb'; - -// check that the client class type name can be used -function doStuffWithAlloyDBAdminClient(client: AlloyDBAdminClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const alloyDBAdminClient = new AlloyDBAdminClient(); - doStuffWithAlloyDBAdminClient(alloyDBAdminClient); -} - -main(); diff --git a/owl-bot-staging/google-cloud-alloydb/v1/system-test/install.ts b/owl-bot-staging/google-cloud-alloydb/v1/system-test/install.ts deleted file mode 100644 index fd5bfdc71d5..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1/test/gapic_alloy_d_b_admin_v1.ts b/owl-bot-staging/google-cloud-alloydb/v1/test/gapic_alloy_d_b_admin_v1.ts deleted file mode 100644 index f5f20bad202..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/test/gapic_alloy_d_b_admin_v1.ts +++ /dev/null @@ -1,6737 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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(); - assert(client.alloyDBAdminStub); - client.close().then(() => { - done(); - }); - }); - - 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(); - }); - }); - - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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('deleteCluster', () => { - it('invokes deleteCluster without error', async () => { - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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); - } - }); - }); - 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', - }); - 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', - }); - 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', - }); - 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); - } - }); - }); - 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', - }); - 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', - }); - 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', - }); - 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); - } - }); - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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); - } - }); - }); - 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', - }); - 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); - } - }); - }); - 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', - }); - 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); - } - }); - }); - 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.ListOperationsResponse[] = []; - 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', - }); - 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.ListOperationsResponse[] = []; - 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', () => { - 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', - }); - 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', () => { - 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', - }); - 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', () => { - 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', - }); - 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', () => { - 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', - }); - 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', () => { - 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', - }); - 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', () => { - 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', - }); - 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', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new alloydbadminModule.v1.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - 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', () => { - 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', - }); - 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', () => { - 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', - }); - 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/v1/tsconfig.json b/owl-bot-staging/google-cloud-alloydb/v1/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/google-cloud-alloydb/v1/webpack.config.js b/owl-bot-staging/google-cloud-alloydb/v1/webpack.config.js deleted file mode 100644 index ee88fe6afc1..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1/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/owl-bot-staging/google-cloud-alloydb/v1alpha/.eslintignore b/owl-bot-staging/google-cloud-alloydb/v1alpha/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/.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/v1alpha/.eslintrc.json b/owl-bot-staging/google-cloud-alloydb/v1alpha/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/.gitignore b/owl-bot-staging/google-cloud-alloydb/v1alpha/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/.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/v1alpha/.jsdoc.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/.jsdoc.js deleted file mode 100644 index 6c10f22a83a..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 2024 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/v1alpha/.mocharc.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/.mocharc.js deleted file mode 100644 index 13b67c34edc..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1alpha/.prettierrc.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/.prettierrc.js deleted file mode 100644 index 9a8fd690982..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1alpha/README.md b/owl-bot-staging/google-cloud-alloydb/v1alpha/README.md deleted file mode 100644 index 433e5333737..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/README.md +++ /dev/null @@ -1 +0,0 @@ -Alloydb: Nodejs Client diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/package.json b/owl-bot-staging/google-cloud-alloydb/v1alpha/package.json deleted file mode 100644 index 7d0d731ff2e..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "@google-cloud/alloydb", - "version": "0.1.0", - "description": "Alloydb client for Node.js", - "repository": "googleapis/nodejs-alloydb", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google alloydb", - "alloydb", - "alloy d b admin" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^4.3.4" - }, - "devDependencies": { - "@types/mocha": "^10.0.6", - "@types/node": "^20.12.12", - "@types/sinon": "^10.0.20", - "c8": "^9.1.0", - "gapic-tools": "^0.4.2", - "gts": "5.3.0", - "jsdoc": "^4.0.3", - "jsdoc-fresh": "^3.0.0", - "jsdoc-region-tag": "^3.0.0", - "mocha": "^10.4.0", - "pack-n-play": "^2.0.3", - "sinon": "^15.2.0", - "typescript": "5.1.6" - }, - "engines": { - "node": ">=v14" - } -} diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/protos/google/cloud/alloydb/v1alpha/resources.proto b/owl-bot-staging/google-cloud-alloydb/v1alpha/protos/google/cloud/alloydb/v1alpha/resources.proto deleted file mode 100644 index 0067e0e9a3c..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/protos/google/cloud/alloydb/v1alpha/resources.proto +++ /dev/null @@ -1,1356 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.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}" -}; - -// 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 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; -} - -// 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 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, e.g. via - // 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 then use default encryption scheme to - // protect the user data. - 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 then use default encryption scheme to - // protect the user data. - 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. Output - // only field. Ignored if passed into the request. - repeated google.type.DayOfWeek schedule = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The earliest restorable time that can be restored to. Output - // only field. - 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]; -} - -// 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}" - 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; - } - - // 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]; - } - - // 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]; - } - - // Cluster State - enum State { - // The state of the cluster is unknown. - STATE_UNSPECIFIED = 0; - - // The cluster is active and running. - READY = 1; - - // The cluster is stopped. All instances in the cluster are stopped. - // Customers can start a stopped cluster at any point and all their - // instances will come back to life with same names and IP resources. In - // this state, customer pays for storage. - // Associated backups could also be present in a stopped cluster. - 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. 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]; -} - -// 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}" - 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; - } - - // Details of a single node in the instance. - // Nodes in an AlloyDB instance are ephemereal, they can change during - // update, failover, autohealing and resize operations. - message Node { - // The Compute Engine zone of the VM e.g. "us-central1-b". - string zone_id = 1; - - // The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". - string id = 2; - - // The private IP address of the VM e.g. "10.57.0.34". - string ip = 3; - - // 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; - } - - // 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; - } - - // 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 config option for this instance. - SslConfig ssl_config = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Configuration for setting up a PSC interface. This information needs to be - // provided by the customer. - // PSC interfaces will be created and added to VMs via SLM (adding a network - // interface will require recreating the VM). For HA instances this will be - // done via LDTM. - message PscInterfaceConfig { - // A list of endpoints in the consumer VPC the interface might initiate - // outbound connections to. This list has to be provided when the PSC - // interface is created. - repeated string consumer_endpoint_ips = 1; - - // The NetworkAttachment resource created in the consumer VPC to which the - // PSC interface will be linked, in the form of: - // "projects/${CONSUMER_PROJECT}/regions/${REGION}/networkAttachments/${NETWORK_ATTACHMENT_NAME}". - // NetworkAttachment has to be provided when the PSC interface is created. - string network_attachment = 2; - } - - // 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]; - - // 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]; - - // Optional. List of consumer networks that are allowed to create - // PSC endpoints to service-attachments to this instance. - repeated string allowed_consumer_networks = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // 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. All the VMs created for the primary - // instance will share the same configurations. Currently we only support 0 - // or 1 PSC interface. - repeated PscInterfaceConfig psc_interface_configs = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. List of service attachments that this instance has created - // endpoints to connect with. Currently, only a single outgoing service - // attachment is supported per instance. - repeated string outgoing_service_attachment_links = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Whether PSC connectivity is enabled for this instance. - // This is populated by referencing the value from the parent cluster. - bool psc_enabled = 6 [(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]; - } - - // 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; - } - - // 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 instance level. - // * They are copied from primary instance on read instance creation. - // * Read instances can set new or override existing flags that are relevant - // for reads, e.g. for enabling columnar cache on a read instance. Flags - // set on read instance may or may not be present on primary. - // - // - // 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; - - // 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_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]; -} - -// 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" - }; - - // 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}" - 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 - 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]; - - // 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]; -} - -// 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}" - }; - - // 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 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 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; -} - -// Message describing User object. -message User { - option (google.api.resource) = { - type: "alloydb.googleapis.com/User" - pattern: "projects/{project}/locations/{location}/clusters/{cluster}/users/{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]; -} - -// 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. 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]; - - // Optional. Collation for the database. - // Name of the custom or native collation for postgres. - // Example values include "C", "POSIX", etc - string collation = 3 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/protos/google/cloud/alloydb/v1alpha/service.proto b/owl-bot-staging/google-cloud-alloydb/v1alpha/protos/google/cloud/alloydb/v1alpha/service.proto deleted file mode 100644 index 2b558324f83..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/protos/google/cloud/alloydb/v1alpha/service.proto +++ /dev/null @@ -1,1641 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/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" - }; - } - - // 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" - }; - } - - // 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" - }; - } - - // 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"; - } -} - -// 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating 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 (e.g. permission checks and - // any other type of validation), but do 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating 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 (e.g. permission checks and - // any other type of validation), but do 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating 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 (e.g. permission checks and - // any other type of validation), but do not actually execute the update - // 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]; -} - -// 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - 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 (e.g. permission checks and - // any other type of validation), but do not actually execute the delete. - 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 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - 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 (e.g. permission checks and - // any other type of validation), but do not actually execute the delete. - 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. -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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating 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 (e.g. permission checks and - // any other type of validation), but do not actually execute the import - // 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating 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 (e.g. permission checks and - // any other type of validation), but do 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating 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 (e.g. permission checks and - // any other type of validation), but do 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating 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 - // processsing 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating 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 (e.g. permission checks and - // any other type of validation), but do not actually execute the update - // 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - 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 (e.g. permission checks and - // any other type of validation), but do not actually execute the delete. - 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation (e.g. permission checks and - // any other type of validation), but do not actually execute the failover. - 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation (e.g. permission checks and - // any other type of validation), but do not actually execute the fault - // injection. - 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation (e.g. permission checks and - // any other type of validation), but do not actually execute the restart. - bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - 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; -} - -// 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - 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 - // ceritificate 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - 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. 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 [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 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - 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 requesting list of Databases. -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, an appropriate number of databases - // will be returned. The max value will be 2000, 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 response to listing Databases. -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/v1alpha/protos/protos.d.ts b/owl-bot-staging/google-cloud-alloydb/v1alpha/protos/protos.d.ts deleted file mode 100644 index 95045a51ef4..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/protos/protos.d.ts +++ /dev/null @@ -1,19263 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 v1alpha. */ - namespace v1alpha { - - /** 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 - } - - /** 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"); - - /** AutomatedBackupPolicy _enabled. */ - public _enabled?: "enabled"; - - /** - * 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); - - /** ContinuousBackupConfig _enabled. */ - public _enabled?: "enabled"; - - /** - * 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 Cluster. */ - interface ICluster { - - /** Cluster backupSource */ - backupSource?: (google.cloud.alloydb.v1alpha.IBackupSource|null); - - /** Cluster migrationSource */ - migrationSource?: (google.cloud.alloydb.v1alpha.IMigrationSource|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); - } - - /** 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 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 source. */ - public source?: ("backupSource"|"migrationSource"); - - /** - * 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); - } - - /** 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; - - /** - * 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; - } - - /** 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 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); - } - - /** 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 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); - - /** - * 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); - } - - /** 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; - - /** - * 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); - - /** QueryInsightsInstanceConfig _recordApplicationTags. */ - public _recordApplicationTags?: "recordApplicationTags"; - - /** QueryInsightsInstanceConfig _recordClientAddress. */ - public _recordClientAddress?: "recordClientAddress"; - - /** QueryInsightsInstanceConfig _queryPlansPerMinute. */ - public _queryPlansPerMinute?: "queryPlansPerMinute"; - - /** - * 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 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 consumerEndpointIps */ - consumerEndpointIps?: (string[]|null); - - /** PscInterfaceConfig networkAttachment */ - networkAttachment?: (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 consumerEndpointIps. */ - public consumerEndpointIps: string[]; - - /** PscInterfaceConfig networkAttachment. */ - public networkAttachment: 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 PscInstanceConfig. */ - interface IPscInstanceConfig { - - /** PscInstanceConfig serviceAttachmentLink */ - serviceAttachmentLink?: (string|null); - - /** PscInstanceConfig allowedConsumerProjects */ - allowedConsumerProjects?: (string[]|null); - - /** PscInstanceConfig allowedConsumerNetworks */ - allowedConsumerNetworks?: (string[]|null); - - /** PscInstanceConfig pscInterfaceConfigs */ - pscInterfaceConfigs?: (google.cloud.alloydb.v1alpha.Instance.IPscInterfaceConfig[]|null); - - /** PscInstanceConfig outgoingServiceAttachmentLinks */ - outgoingServiceAttachmentLinks?: (string[]|null); - - /** PscInstanceConfig pscEnabled */ - pscEnabled?: (boolean|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 allowedConsumerNetworks. */ - public allowedConsumerNetworks: string[]; - - /** PscInstanceConfig pscInterfaceConfigs. */ - public pscInterfaceConfigs: google.cloud.alloydb.v1alpha.Instance.IPscInterfaceConfig[]; - - /** PscInstanceConfig outgoingServiceAttachmentLinks. */ - public outgoingServiceAttachmentLinks: string[]; - - /** PscInstanceConfig pscEnabled. */ - public pscEnabled: boolean; - - /** - * 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); - } - - /** 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; - - /** - * 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; - } - } - - /** 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 - } - } - - /** 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 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); - } - - /** 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 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); - - /** - * 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 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); - } - - /** 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 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 restrictions. */ - public restrictions?: ("stringRestrictions"|"integerRestrictions"); - - /** - * 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 - } - } - - /** 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); - } - - /** 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); - - /** - * 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); - } - - /** 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; - - /** - * 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; - } - - /** 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 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 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 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; - } - - 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|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|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|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; - } - - /** 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 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 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); - } - - /** 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; - - /** - * 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 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); - } - - /** 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; - - /** - * 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 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 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"; - - /** - * 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 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; - } - } - } - } - - /** 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 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 - } - } - - /** 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 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 - } - } - - /** 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.fieldInfo */ - ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); - - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|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|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|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|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|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|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|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 { - - /** 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/v1alpha/protos/protos.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/protos/protos.js deleted file mode 100644 index daaf21ff204..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/protos/protos.js +++ /dev/null @@ -1,49802 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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.v1alpha = (function() { - - /** - * Namespace v1alpha. - * @memberof google.cloud.alloydb - * @namespace - */ - var v1alpha = {}; - - /** - * 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 - */ - 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; - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) - }); - - /** - * AutomatedBackupPolicy _enabled. - * @member {"enabled"|undefined} _enabled - * @memberof google.cloud.alloydb.v1alpha.AutomatedBackupPolicy - * @instance - */ - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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; - - /** - * ContinuousBackupConfig _enabled. - * @member {"enabled"|undefined} _enabled - * @memberof google.cloud.alloydb.v1alpha.ContinuousBackupConfig - * @instance - */ - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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.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 {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 - */ - - /** - * 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 = {}; - if (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 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; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Cluster source. - * @member {"backupSource"|"migrationSource"|undefined} source - * @memberof google.cloud.alloydb.v1alpha.Cluster - * @instance - */ - Object.defineProperty(Cluster.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["backupSource", "migrationSource"]), - 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.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.satisfiesPzi); - 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) { - 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(); - 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 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; - } - 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.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: - 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; - } - 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.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; - } - 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); - } - 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 = {}; - } - 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.satisfiesPzi = false; - } - 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.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - object.satisfiesPzi = message.satisfiesPzi; - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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 - */ - - /** - * 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; - - /** - * 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); - 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.pscEnabled = reader.bool(); - 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"; - 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); - 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 (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) - object.pscEnabled = message.pscEnabled; - 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; - })(); - - /** - * 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.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 - */ - - /** - * 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 = {}; - if (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 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; - - /** - * 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.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); - 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) { - 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(); - 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 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; - } - 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.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; - } - 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.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); - } - 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 = []; - 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.publicIpAddress = ""; - object.pscInstanceConfig = null; - object.networkConfig = null; - object.satisfiesPzi = false; - } - 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.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; - 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 - */ - - /** - * 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; - - /** - * 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); - 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.cpuCount = reader.int32(); - 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"; - 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; - 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; - if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) - object.cpuCount = message.cpuCount; - 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) { - 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(); - 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; - - /** - * QueryInsightsInstanceConfig _recordApplicationTags. - * @member {"recordApplicationTags"|undefined} _recordApplicationTags - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @instance - */ - Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordApplicationTags", { - get: $util.oneOfGetter($oneOfFields = ["recordApplicationTags"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * QueryInsightsInstanceConfig _recordClientAddress. - * @member {"recordClientAddress"|undefined} _recordClientAddress - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @instance - */ - Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordClientAddress", { - get: $util.oneOfGetter($oneOfFields = ["recordClientAddress"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * QueryInsightsInstanceConfig _queryPlansPerMinute. - * @member {"queryPlansPerMinute"|undefined} _queryPlansPerMinute - * @memberof google.cloud.alloydb.v1alpha.Instance.QueryInsightsInstanceConfig - * @instance - */ - 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) { - 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(); - 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.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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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 {Array.|null} [consumerEndpointIps] PscInterfaceConfig consumerEndpointIps - * @property {string|null} [networkAttachment] PscInterfaceConfig networkAttachment - */ - - /** - * 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) { - this.consumerEndpointIps = []; - if (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 consumerEndpointIps. - * @member {Array.} consumerEndpointIps - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig - * @instance - */ - PscInterfaceConfig.prototype.consumerEndpointIps = $util.emptyArray; - - /** - * PscInterfaceConfig networkAttachment. - * @member {string} networkAttachment - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig - * @instance - */ - PscInterfaceConfig.prototype.networkAttachment = ""; - - /** - * 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.consumerEndpointIps != null && message.consumerEndpointIps.length) - for (var i = 0; i < message.consumerEndpointIps.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.consumerEndpointIps[i]); - if (message.networkAttachment != null && Object.hasOwnProperty.call(message, "networkAttachment")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.networkAttachment); - 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) { - 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(); - switch (tag >>> 3) { - case 1: { - if (!(message.consumerEndpointIps && message.consumerEndpointIps.length)) - message.consumerEndpointIps = []; - message.consumerEndpointIps.push(reader.string()); - break; - } - case 2: { - message.networkAttachment = 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.consumerEndpointIps != null && message.hasOwnProperty("consumerEndpointIps")) { - if (!Array.isArray(message.consumerEndpointIps)) - return "consumerEndpointIps: array expected"; - for (var i = 0; i < message.consumerEndpointIps.length; ++i) - if (!$util.isString(message.consumerEndpointIps[i])) - return "consumerEndpointIps: string[] expected"; - } - if (message.networkAttachment != null && message.hasOwnProperty("networkAttachment")) - if (!$util.isString(message.networkAttachment)) - return "networkAttachment: 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.consumerEndpointIps) { - if (!Array.isArray(object.consumerEndpointIps)) - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig.consumerEndpointIps: array expected"); - message.consumerEndpointIps = []; - for (var i = 0; i < object.consumerEndpointIps.length; ++i) - message.consumerEndpointIps[i] = String(object.consumerEndpointIps[i]); - } - if (object.networkAttachment != null) - message.networkAttachment = String(object.networkAttachment); - 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.arrays || options.defaults) - object.consumerEndpointIps = []; - if (options.defaults) - object.networkAttachment = ""; - if (message.consumerEndpointIps && message.consumerEndpointIps.length) { - object.consumerEndpointIps = []; - for (var j = 0; j < message.consumerEndpointIps.length; ++j) - object.consumerEndpointIps[j] = message.consumerEndpointIps[j]; - } - if (message.networkAttachment != null && message.hasOwnProperty("networkAttachment")) - object.networkAttachment = message.networkAttachment; - 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.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 {Array.|null} [allowedConsumerNetworks] PscInstanceConfig allowedConsumerNetworks - * @property {Array.|null} [pscInterfaceConfigs] PscInstanceConfig pscInterfaceConfigs - * @property {Array.|null} [outgoingServiceAttachmentLinks] PscInstanceConfig outgoingServiceAttachmentLinks - * @property {boolean|null} [pscEnabled] PscInstanceConfig pscEnabled - */ - - /** - * 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.allowedConsumerNetworks = []; - this.pscInterfaceConfigs = []; - this.outgoingServiceAttachmentLinks = []; - if (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 allowedConsumerNetworks. - * @member {Array.} allowedConsumerNetworks - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig - * @instance - */ - PscInstanceConfig.prototype.allowedConsumerNetworks = $util.emptyArray; - - /** - * PscInstanceConfig pscInterfaceConfigs. - * @member {Array.} pscInterfaceConfigs - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig - * @instance - */ - PscInstanceConfig.prototype.pscInterfaceConfigs = $util.emptyArray; - - /** - * PscInstanceConfig outgoingServiceAttachmentLinks. - * @member {Array.} outgoingServiceAttachmentLinks - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig - * @instance - */ - PscInstanceConfig.prototype.outgoingServiceAttachmentLinks = $util.emptyArray; - - /** - * PscInstanceConfig pscEnabled. - * @member {boolean} pscEnabled - * @memberof google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig - * @instance - */ - PscInstanceConfig.prototype.pscEnabled = false; - - /** - * 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.allowedConsumerNetworks != null && message.allowedConsumerNetworks.length) - for (var i = 0; i < message.allowedConsumerNetworks.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.allowedConsumerNetworks[i]); - 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 4, wireType 2 =*/34).fork()).ldelim(); - if (message.outgoingServiceAttachmentLinks != null && message.outgoingServiceAttachmentLinks.length) - for (var i = 0; i < message.outgoingServiceAttachmentLinks.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.outgoingServiceAttachmentLinks[i]); - if (message.pscEnabled != null && Object.hasOwnProperty.call(message, "pscEnabled")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.pscEnabled); - 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) { - 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(); - 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 3: { - if (!(message.allowedConsumerNetworks && message.allowedConsumerNetworks.length)) - message.allowedConsumerNetworks = []; - message.allowedConsumerNetworks.push(reader.string()); - break; - } - case 4: { - if (!(message.pscInterfaceConfigs && message.pscInterfaceConfigs.length)) - message.pscInterfaceConfigs = []; - message.pscInterfaceConfigs.push($root.google.cloud.alloydb.v1alpha.Instance.PscInterfaceConfig.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.outgoingServiceAttachmentLinks && message.outgoingServiceAttachmentLinks.length)) - message.outgoingServiceAttachmentLinks = []; - message.outgoingServiceAttachmentLinks.push(reader.string()); - break; - } - case 6: { - message.pscEnabled = reader.bool(); - 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.allowedConsumerNetworks != null && message.hasOwnProperty("allowedConsumerNetworks")) { - if (!Array.isArray(message.allowedConsumerNetworks)) - return "allowedConsumerNetworks: array expected"; - for (var i = 0; i < message.allowedConsumerNetworks.length; ++i) - if (!$util.isString(message.allowedConsumerNetworks[i])) - return "allowedConsumerNetworks: 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.outgoingServiceAttachmentLinks != null && message.hasOwnProperty("outgoingServiceAttachmentLinks")) { - if (!Array.isArray(message.outgoingServiceAttachmentLinks)) - return "outgoingServiceAttachmentLinks: array expected"; - for (var i = 0; i < message.outgoingServiceAttachmentLinks.length; ++i) - if (!$util.isString(message.outgoingServiceAttachmentLinks[i])) - return "outgoingServiceAttachmentLinks: string[] expected"; - } - if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) - if (typeof message.pscEnabled !== "boolean") - return "pscEnabled: boolean expected"; - 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.allowedConsumerNetworks) { - if (!Array.isArray(object.allowedConsumerNetworks)) - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.allowedConsumerNetworks: array expected"); - message.allowedConsumerNetworks = []; - for (var i = 0; i < object.allowedConsumerNetworks.length; ++i) - message.allowedConsumerNetworks[i] = String(object.allowedConsumerNetworks[i]); - } - 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.outgoingServiceAttachmentLinks) { - if (!Array.isArray(object.outgoingServiceAttachmentLinks)) - throw TypeError(".google.cloud.alloydb.v1alpha.Instance.PscInstanceConfig.outgoingServiceAttachmentLinks: array expected"); - message.outgoingServiceAttachmentLinks = []; - for (var i = 0; i < object.outgoingServiceAttachmentLinks.length; ++i) - message.outgoingServiceAttachmentLinks[i] = String(object.outgoingServiceAttachmentLinks[i]); - } - if (object.pscEnabled != null) - message.pscEnabled = Boolean(object.pscEnabled); - 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.allowedConsumerNetworks = []; - object.pscInterfaceConfigs = []; - object.outgoingServiceAttachmentLinks = []; - } - if (options.defaults) { - object.serviceAttachmentLink = ""; - object.pscEnabled = false; - } - 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.allowedConsumerNetworks && message.allowedConsumerNetworks.length) { - object.allowedConsumerNetworks = []; - for (var j = 0; j < message.allowedConsumerNetworks.length; ++j) - object.allowedConsumerNetworks[j] = message.allowedConsumerNetworks[j]; - } - 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.outgoingServiceAttachmentLinks && message.outgoingServiceAttachmentLinks.length) { - object.outgoingServiceAttachmentLinks = []; - for (var j = 0; j < message.outgoingServiceAttachmentLinks.length; ++j) - object.outgoingServiceAttachmentLinks[j] = message.outgoingServiceAttachmentLinks[j]; - } - if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) - object.pscEnabled = message.pscEnabled; - 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 - */ - - /** - * 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; - - /** - * 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); - 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) { - 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(); - 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; - } - 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"; - 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); - 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; - 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; - 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) { - 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(); - 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; - })(); - - /** - * 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; - })(); - - 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) { - 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(); - 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 {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 - */ - - /** - * 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 = {}; - if (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 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; - - /** - * 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); - 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) { - 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(); - 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 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; - } - 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.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: - break; - } - 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.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; - } - 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 = {}; - } - 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; - } - 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; - 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) { - 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(); - 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} [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 - */ - - /** - * 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 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; - - // 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) - }); - - /** - * 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(); - 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) { - 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(); - 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 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; - } - 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.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: - break; - } - } - if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) - if (typeof message.requiresDbRestart !== "boolean") - return "requiresDbRestart: boolean expected"; - 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.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; - } - } - if (object.requiresDbRestart != null) - message.requiresDbRestart = Boolean(object.requiresDbRestart); - 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; - } - 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"; - } - 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) { - 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(); - 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) { - 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(); - 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; - })(); - - 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 - */ - - /** - * 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; - - /** - * 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); - 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) { - 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(); - 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; - } - 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; - } - 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; - } - 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; - } - 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; - 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 - */ - - /** - * 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 = ""; - - /** - * 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); - 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.charset = reader.string(); - break; - } - case 3: { - message.collation = reader.string(); - 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"; - 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"; - 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); - 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 = ""; - } - 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; - 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; - })(); - - 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|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|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|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 - */ - - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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.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) { - 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(); - 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.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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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 - */ - - /** - * 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) { - if (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; - - /** - * 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); - 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) { - 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(); - 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 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"; - 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); - 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.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 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.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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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 - */ - - /** - * 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 = ""; - - /** - * 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); - 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.parent = 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 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"; - 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); - 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 = ""; - } - 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; - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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.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 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"|undefined} requestSpecific - * @memberof google.cloud.alloydb.v1alpha.OperationMetadata - * @instance - */ - Object.defineProperty(OperationMetadata.prototype, "requestSpecific", { - get: $util.oneOfGetter($oneOfFields = ["batchCreateInstancesMetadata"]), - 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(); - 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) { - 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(); - switch (tag >>> 3) { - case 8: { - message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1alpha.BatchCreateInstancesMetadata.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.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.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"; - } - 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.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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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; - })(); - - return v1alpha; - })(); - - 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.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) { - 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(); - 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; - })(); - - 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) { - 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(); - 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) { - 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(); - 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.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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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; - })(); - - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference - */ - - /** - * 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.fieldInfo. - * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldInfo"] = null; - - /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.resourceReference"] = 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) { - 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(); - 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 291403980: { - message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); - break; - } - case 1055: { - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.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.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; - } - 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; - } - 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.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"]); - } - 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"]); - } - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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 = {}; - - /** - * 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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/v1alpha/protos/protos.json b/owl-bot-staging/google-cloud-alloydb/v1alpha/protos/protos.json deleted file mode 100644 index b367bc0931a..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/protos/protos.json +++ /dev/null @@ -1,5762 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "cloud": { - "nested": { - "alloydb": { - "nested": { - "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": "ServiceProto", - "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/Network", - "(google.api.resource_definition).pattern": "projects/{project}/global/networks/{network}" - }, - "nested": { - "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 - } - }, - "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 - } - } - }, - "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" - } - } - } - }, - "Cluster": { - "options": { - "(google.api.resource).type": "alloydb.googleapis.com/Cluster", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}", - "(google.api.resource).style": "DECLARATIVE_FRIENDLY" - }, - "oneofs": { - "source": { - "oneof": [ - "backupSource", - "migrationSource" - ] - } - }, - "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" - } - }, - "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" - } - } - }, - "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 - } - } - }, - "PrimaryConfig": { - "fields": { - "secondaryClusterNames": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "PscConfig": { - "fields": { - "pscEnabled": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "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).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 - }, - "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_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" - } - } - }, - "nested": { - "MachineConfig": { - "fields": { - "cpuCount": { - "type": "int32", - "id": 1 - } - } - }, - "Node": { - "fields": { - "zoneId": { - "type": "string", - "id": 1 - }, - "id": { - "type": "string", - "id": 2 - }, - "ip": { - "type": "string", - "id": 3 - }, - "state": { - "type": "string", - "id": 4 - } - } - }, - "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 - } - } - } - }, - "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": { - "consumerEndpointIps": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "networkAttachment": { - "type": "string", - "id": 2 - } - } - }, - "PscInstanceConfig": { - "fields": { - "serviceAttachmentLink": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "allowedConsumerProjects": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowedConsumerNetworks": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pscInterfaceConfigs": { - "rule": "repeated", - "type": "PscInterfaceConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "outgoingServiceAttachmentLinks": { - "rule": "repeated", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pscEnabled": { - "type": "bool", - "id": 6, - "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" - } - } - }, - "nested": { - "AuthorizedNetwork": { - "fields": { - "cidrRange": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_info).format": "IPV4" - } - } - } - } - } - }, - "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 - } - } - } - }, - "ConnectionInfo": { - "options": { - "(google.api.resource).type": "alloydb.googleapis.com/ConnectionInfo", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/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).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" - } - }, - "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" - } - } - }, - "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}" - }, - "oneofs": { - "restrictions": { - "oneof": [ - "stringRestrictions", - "integerRestrictions" - ] - } - }, - "fields": { - "stringRestrictions": { - "type": "StringRestrictions", - "id": 7 - }, - "integerRestrictions": { - "type": "IntegerRestrictions", - "id": 8 - }, - "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 - } - }, - "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 - } - } - } - }, - "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).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" - } - } - }, - "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" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "charset": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "collation": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "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" - } - } - ] - }, - "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" - } - } - ] - }, - "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" - } - } - ] - }, - "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" - } - ] - } - } - }, - "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" - } - } - } - }, - "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" - } - } - } - }, - "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" - } - } - } - }, - "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 - } - } - }, - "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" - ] - } - }, - "fields": { - "batchCreateInstancesMetadata": { - "type": "BatchCreateInstancesMetadata", - "id": 8, - "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" - } - } - } - }, - "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 - } - } - } - } - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api;api", - "java_multiple_files": true, - "java_outer_classname": "LaunchStageProto", - "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 - } - }, - "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 - } - } - } - }, - "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 - } - } - }, - "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 - } - } - } - }, - "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": { - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - } - }, - "Edition": { - "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": { - "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, - "options": { - "packed": false - } - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11, - "options": { - "packed": false - } - }, - "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": { - "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": { - "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": { - "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": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "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": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - } - }, - "MethodDescriptorProto": { - "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": { - "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": { - "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": { - "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, - "options": { - "packed": false - } - }, - "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": { - "fields": { - "features": { - "type": "FeatureSet", - "id": 1 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "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": { - "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": { - "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": { - "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": { - "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": { - "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": { - "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": { - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2 - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "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": { - "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", - "cc_enable_arenas": true - }, - "nested": { - "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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js deleted file mode 100644 index 6d5b16a322c..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_backup.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_backup.js deleted file mode 100644 index d4a23cbe949..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_backup.js +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js deleted file mode 100644 index c65274beab4..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating 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 (e.g. permission checks and - * any other type of validation), but do 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_instance.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_instance.js deleted file mode 100644 index 709cd563606..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_instance.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating 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 (e.g. permission checks and - * any other type of validation), but do 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js deleted file mode 100644 index 98b5c37ad22..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating 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 (e.g. permission checks and - * any other type of validation), but do 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js deleted file mode 100644 index 422c1934e11..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating 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 (e.g. permission checks and - * any other type of validation), but do 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_user.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_user.js deleted file mode 100644 index a889fa6c6b1..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.create_user.js +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js deleted file mode 100644 index b4dbcd61d12..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js deleted file mode 100644 index 6a0f8a0e943..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - */ - // 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js deleted file mode 100644 index 818fb128871..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - */ - // 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js deleted file mode 100644 index b3fd509453e..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js deleted file mode 100644 index 4ce4c2c9f7e..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. - */ - // 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js deleted file mode 100644 index 44a96df8881..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // 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 - * ceritificate 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_backup.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_backup.js deleted file mode 100644 index 0a74134f9fd..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_backup.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js deleted file mode 100644 index bccd6a9ce28..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js deleted file mode 100644 index 0dbfe505308..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_instance.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_instance.js deleted file mode 100644 index 1fc985b7e37..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_instance.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_user.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_user.js deleted file mode 100644 index 7f70b5937ba..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.get_user.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js deleted file mode 100644 index b22ccc99fae..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the fault - * injection. - */ - // 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_backups.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_backups.js deleted file mode 100644 index 53e52fe2ffd..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_backups.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js deleted file mode 100644 index ed4e90d94d7..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_databases.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_databases.js deleted file mode 100644 index 3b9770aa516..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_databases.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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, an appropriate number of databases - * will be returned. The max value will be 2000, 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_instances.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_instances.js deleted file mode 100644 index 87a01b0ff90..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_instances.js +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js deleted file mode 100644 index e198bcb7061..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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' - - // 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_users.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_users.js deleted file mode 100644 index f94287e2519..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.list_users.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js deleted file mode 100644 index 9d00328cb06..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - */ - // 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js deleted file mode 100644 index 0cc6d85f219..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the restart. - */ - // const validateOnly = true - - // 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js deleted file mode 100644 index 3a70c6354f9..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the import - * 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_backup.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_backup.js deleted file mode 100644 index adc09dfe701..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_backup.js +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js deleted file mode 100644 index ad995dd5a91..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_instance.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_instance.js deleted file mode 100644 index d20a503fce4..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_instance.js +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * 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/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_user.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_user.js deleted file mode 100644 index fab59af7d9e..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/alloy_d_b_admin.update_user.js +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating 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/v1alpha/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json b/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json deleted file mode 100644 index f40496a17ad..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json +++ /dev/null @@ -1,1691 +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_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": 84, - "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": 80, - "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_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": 80, - "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": 74, - "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": 74, - "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" - } - ], - "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_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": 69, - "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" - } - ], - "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" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/src/index.ts b/owl-bot-staging/google-cloud-alloydb/v1alpha/src/index.ts deleted file mode 100644 index 72c99e931d0..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 v1alpha from './v1alpha'; -const AlloyDBAdminClient = v1alpha.AlloyDBAdminClient; -type AlloyDBAdminClient = v1alpha.AlloyDBAdminClient; -export {v1alpha, AlloyDBAdminClient}; -export default {v1alpha, AlloyDBAdminClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/alloy_d_b_admin_client.ts b/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/alloy_d_b_admin_client.ts deleted file mode 100644 index 85ee3ba5144..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/alloy_d_b_admin_client.ts +++ /dev/null @@ -1,5218 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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'); - -/** - * 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; - 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://developers.google.com/identity/protocols/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.protobuf.Root.fromJSON(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 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 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)), - 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)), - 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', 'deleteCluster', 'promoteCluster', 'restoreCluster', 'createSecondaryCluster', 'listInstances', 'getInstance', 'createInstance', 'createSecondaryInstance', 'batchCreateInstances', 'updateInstance', 'deleteInstance', 'failoverInstance', 'injectFault', 'restartInstance', '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.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(); - return this.innerApiCalls.getCluster(request, options, callback); - } -/** - * 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(); - return this.innerApiCalls.getInstance(request, options, callback); - } -/** - * 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(); - return this.innerApiCalls.getBackup(request, options, callback); - } -/** - * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @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 - * ceritificate 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(); - return this.innerApiCalls.generateClientCertificate(request, options, callback); - } -/** - * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @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(); - return this.innerApiCalls.getConnectionInfo(request, options, callback); - } -/** - * 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(); - return this.innerApiCalls.getUser(request, options, callback); - } -/** - * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate 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(); - return this.innerApiCalls.createUser(request, options, callback); - } -/** - * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate 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(); - return this.innerApiCalls.updateUser(request, options, callback); - } -/** - * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @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(); - return this.innerApiCalls.deleteUser(request, options, callback); - } - -/** - * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate 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 (e.g. permission checks and - * any other type of validation), but do 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(); - return this.innerApiCalls.createCluster(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * 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(); - return this.innerApiCalls.updateCluster(request, options, callback); - } -/** - * 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>{ - 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; - } -/** - * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @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 (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * @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(); - return this.innerApiCalls.deleteCluster(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @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 (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * @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(); - return this.innerApiCalls.promoteCluster(request, options, callback); - } -/** - * 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>{ - 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; - } -/** - * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the import - * 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(); - return this.innerApiCalls.restoreCluster(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate 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 (e.g. permission checks and - * any other type of validation), but do 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(); - return this.innerApiCalls.createSecondaryCluster(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate 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 (e.g. permission checks and - * any other type of validation), but do 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(); - return this.innerApiCalls.createInstance(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate 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 (e.g. permission checks and - * any other type of validation), but do 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(); - return this.innerApiCalls.createSecondaryInstance(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate 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(); - return this.innerApiCalls.batchCreateInstances(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * 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(); - return this.innerApiCalls.updateInstance(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @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 (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * @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(); - return this.innerApiCalls.deleteInstance(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {boolean} [request.validateOnly] - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. - * @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(); - return this.innerApiCalls.failoverInstance(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {boolean} [request.validateOnly] - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the fault - * injection. - * @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(); - return this.innerApiCalls.injectFault(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {boolean} [request.validateOnly] - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the restart. - * @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(); - return this.innerApiCalls.restartInstance(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate 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(); - return this.innerApiCalls.createBackup(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate 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(); - return this.innerApiCalls.updateBackup(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @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(); - return this.innerApiCalls.deleteBackup(request, options, callback); - } -/** - * 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>{ - 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(); - return this.innerApiCalls.listClusters(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, 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(); - 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(); - 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(); - return this.innerApiCalls.listInstances(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, 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(); - 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(); - 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(); - return this.innerApiCalls.listBackups(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, 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(); - 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(); - 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 {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(); - return this.innerApiCalls.listSupportedDatabaseFlags(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, 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 {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(); - 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 {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(); - 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(); - return this.innerApiCalls.listUsers(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, 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(); - 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(); - 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, an appropriate number of databases - * will be returned. The max value will be 2000, 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(); - return this.innerApiCalls.listDatabases(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, 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, an appropriate number of databases - * will be returned. The max value will be 2000, 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(); - 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, an appropriate number of databases - * will be returned. The max value will be 2000, 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(); - 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, - options?: - | 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]> { - 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 { - 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, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - 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, - options?: - | 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 { - 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._terminated = true; - stub.close(); - this.iamClient.close(); - this.locationsClient.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/alloy_d_b_admin_client_config.json b/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/alloy_d_b_admin_client_config.json deleted file mode 100644 index 7797b0882b9..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/alloy_d_b_admin_client_config.json +++ /dev/null @@ -1,198 +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" - }, - "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" - }, - "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" - }, - "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" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/alloy_d_b_admin_proto_list.json b/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/alloy_d_b_admin_proto_list.json deleted file mode 100644 index d0ed20f71a9..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/alloy_d_b_admin_proto_list.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "../../protos/google/cloud/alloydb/v1alpha/resources.proto", - "../../protos/google/cloud/alloydb/v1alpha/service.proto" -] diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/gapic_metadata.json b/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/gapic_metadata.json deleted file mode 100644 index d6cc2fd9d80..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/gapic_metadata.json +++ /dev/null @@ -1,367 +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" - ] - }, - "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" - ] - }, - "DeleteCluster": { - "methods": [ - "deleteCluster" - ] - }, - "PromoteCluster": { - "methods": [ - "promoteCluster" - ] - }, - "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" - ] - }, - "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" - ] - }, - "DeleteCluster": { - "methods": [ - "deleteCluster" - ] - }, - "PromoteCluster": { - "methods": [ - "promoteCluster" - ] - }, - "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" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/index.ts b/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/index.ts deleted file mode 100644 index 93eec87dc06..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/src/v1alpha/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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'; diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/system-test/fixtures/sample/src/index.js deleted file mode 100644 index f26aa8e2c06..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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(); -} - -main(); diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-alloydb/v1alpha/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index bd7a760f403..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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} from '@google-cloud/alloydb'; - -// check that the client class type name can be used -function doStuffWithAlloyDBAdminClient(client: AlloyDBAdminClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const alloyDBAdminClient = new AlloyDBAdminClient(); - doStuffWithAlloyDBAdminClient(alloyDBAdminClient); -} - -main(); diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/system-test/install.ts b/owl-bot-staging/google-cloud-alloydb/v1alpha/system-test/install.ts deleted file mode 100644 index fd5bfdc71d5..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1alpha/test/gapic_alloy_d_b_admin_v1alpha.ts b/owl-bot-staging/google-cloud-alloydb/v1alpha/test/gapic_alloy_d_b_admin_v1alpha.ts deleted file mode 100644 index 3adc2c4aa8f..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/test/gapic_alloy_d_b_admin_v1alpha.ts +++ /dev/null @@ -1,6475 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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(); - assert(client.alloyDBAdminStub); - client.close().then(() => { - done(); - }); - }); - - 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(); - }); - }); - - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - await assert.rejects(client.getInstance(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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - await assert.rejects(client.deleteUser(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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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('deleteCluster', () => { - it('invokes deleteCluster without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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('restoreCluster', () => { - it('invokes restoreCluster without error', async () => { - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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); - } - }); - }); - 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', - }); - 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', - }); - 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', - }); - 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); - } - }); - }); - 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', - }); - 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', - }); - 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', - }); - 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); - } - }); - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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); - } - }); - }); - 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', - }); - 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); - } - }); - }); - 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', - }); - 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); - } - }); - }); - 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.ListOperationsResponse[] = []; - 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', - }); - 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.ListOperationsResponse[] = []; - 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', () => { - 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', - }); - 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', () => { - 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', - }); - 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', () => { - 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', - }); - 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', () => { - 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', - }); - 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', () => { - 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', - }); - 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', () => { - 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', - }); - 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', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new alloydbadminModule.v1alpha.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - 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', () => { - 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', - }); - 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', () => { - 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', - }); - 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/v1alpha/tsconfig.json b/owl-bot-staging/google-cloud-alloydb/v1alpha/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/google-cloud-alloydb/v1alpha/webpack.config.js b/owl-bot-staging/google-cloud-alloydb/v1alpha/webpack.config.js deleted file mode 100644 index ee88fe6afc1..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1alpha/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/owl-bot-staging/google-cloud-alloydb/v1beta/.eslintignore b/owl-bot-staging/google-cloud-alloydb/v1beta/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/.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/v1beta/.eslintrc.json b/owl-bot-staging/google-cloud-alloydb/v1beta/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/.gitignore b/owl-bot-staging/google-cloud-alloydb/v1beta/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/.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/v1beta/.jsdoc.js b/owl-bot-staging/google-cloud-alloydb/v1beta/.jsdoc.js deleted file mode 100644 index 6c10f22a83a..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 2024 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/v1beta/.mocharc.js b/owl-bot-staging/google-cloud-alloydb/v1beta/.mocharc.js deleted file mode 100644 index 13b67c34edc..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1beta/.prettierrc.js b/owl-bot-staging/google-cloud-alloydb/v1beta/.prettierrc.js deleted file mode 100644 index 9a8fd690982..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1beta/README.md b/owl-bot-staging/google-cloud-alloydb/v1beta/README.md deleted file mode 100644 index 433e5333737..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/README.md +++ /dev/null @@ -1 +0,0 @@ -Alloydb: Nodejs Client diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/package.json b/owl-bot-staging/google-cloud-alloydb/v1beta/package.json deleted file mode 100644 index 7d0d731ff2e..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "@google-cloud/alloydb", - "version": "0.1.0", - "description": "Alloydb client for Node.js", - "repository": "googleapis/nodejs-alloydb", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google alloydb", - "alloydb", - "alloy d b admin" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^4.3.4" - }, - "devDependencies": { - "@types/mocha": "^10.0.6", - "@types/node": "^20.12.12", - "@types/sinon": "^10.0.20", - "c8": "^9.1.0", - "gapic-tools": "^0.4.2", - "gts": "5.3.0", - "jsdoc": "^4.0.3", - "jsdoc-fresh": "^3.0.0", - "jsdoc-region-tag": "^3.0.0", - "mocha": "^10.4.0", - "pack-n-play": "^2.0.3", - "sinon": "^15.2.0", - "typescript": "5.1.6" - }, - "engines": { - "node": ">=v14" - } -} diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/protos/google/cloud/alloydb/v1beta/resources.proto b/owl-bot-staging/google-cloud-alloydb/v1beta/protos/google/cloud/alloydb/v1beta/resources.proto deleted file mode 100644 index 4fee0dc94ba..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/protos/google/cloud/alloydb/v1beta/resources.proto +++ /dev/null @@ -1,1386 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.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}" -}; - -// 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 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; -} - -// 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 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, e.g. via - // 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 then use default encryption scheme to - // protect the user data. - 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 then use default encryption scheme to - // protect the user data. - 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. Output - // only field. Ignored if passed into the request. - repeated google.type.DayOfWeek schedule = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The earliest restorable time that can be restored to. Output - // only field. - 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; - } - - // Preferred windows to perform maintenance. Currently limited to 1. - repeated MaintenanceWindow maintenance_windows = 1; -} - -// 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}" - 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; - } - - // 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]; - } - - // Cluster State - enum State { - // The state of the cluster is unknown. - STATE_UNSPECIFIED = 0; - - // The cluster is active and running. - READY = 1; - - // The cluster is stopped. All instances in the cluster are stopped. - // Customers can start a stopped cluster at any point and all their - // instances will come back to life with same names and IP resources. In - // this state, customer pays for storage. - // Associated backups could also be present in a stopped cluster. - 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. 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 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]; -} - -// 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}" - 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; - } - - // Details of a single node in the instance. - // Nodes in an AlloyDB instance are ephemereal, they can change during - // update, failover, autohealing and resize operations. - message Node { - // The Compute Engine zone of the VM e.g. "us-central1-b". - string zone_id = 1; - - // The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". - string id = 2; - - // The private IP address of the VM e.g. "10.57.0.34". - string ip = 3; - - // 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; - } - - // 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; - } - - // 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 config option for this instance. - SslConfig ssl_config = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Configuration for setting up a PSC interface. This information needs to be - // provided by the customer. - // PSC interfaces will be created and added to VMs via SLM (adding a network - // interface will require recreating the VM). For HA instances this will be - // done via LDTM. - message PscInterfaceConfig { - // A list of endpoints in the consumer VPC the interface might initiate - // outbound connections to. This list has to be provided when the PSC - // interface is created. - repeated string consumer_endpoint_ips = 1; - - // The NetworkAttachment resource created in the consumer VPC to which the - // PSC interface will be linked, in the form of: - // `projects/${CONSUMER_PROJECT}/regions/${REGION}/networkAttachments/${NETWORK_ATTACHMENT_NAME}`. - // NetworkAttachment has to be provided when the PSC interface is created. - string network_attachment = 2; - } - - // 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]; - - // 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]; - - // Optional. List of consumer networks that are allowed to create - // PSC endpoints to service-attachments to this instance. - repeated string allowed_consumer_networks = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // 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. All the VMs created for the primary - // instance will share the same configurations. Currently we only support 0 - // or 1 PSC interface. - repeated PscInterfaceConfig psc_interface_configs = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. List of service attachments that this instance has created - // endpoints to connect with. Currently, only a single outgoing service - // attachment is supported per instance. - repeated string outgoing_service_attachment_links = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Whether PSC connectivity is enabled for this instance. - // This is populated by referencing the value from the parent cluster. - bool psc_enabled = 6 [(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]; - } - - // 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; - } - - // 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 instance level. - // * They are copied from primary instance on read instance creation. - // * Read instances can set new or override existing flags that are relevant - // for reads, e.g. for enabling columnar cache on a read instance. Flags - // set on read instance may or may not be present on primary. - // - // - // 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; - - // 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]; - - // 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 - ]; -} - -// 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" - }; - - // 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}" - 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 - 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]; - - // 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]; -} - -// 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}" - }; - - // 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 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 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; -} - -// Message describing User object. -message User { - option (google.api.resource) = { - type: "alloydb.googleapis.com/User" - pattern: "projects/{project}/locations/{location}/clusters/{cluster}/users/{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]; -} - -// 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. 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]; - - // Optional. Collation for the database. - // Name of the custom or native collation for postgres. - // Example values include "C", "POSIX", etc - string collation = 3 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/protos/google/cloud/alloydb/v1beta/service.proto b/owl-bot-staging/google-cloud-alloydb/v1beta/protos/google/cloud/alloydb/v1beta/service.proto deleted file mode 100644 index 5a7a1cb0fad..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/protos/google/cloud/alloydb/v1beta/service.proto +++ /dev/null @@ -1,1641 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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/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" - }; - } - - // 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" - }; - } - - // 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" - }; - } - - // 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"; - } -} - -// 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating 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 (e.g. permission checks and - // any other type of validation), but do 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating 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 (e.g. permission checks and - // any other type of validation), but do 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating 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 (e.g. permission checks and - // any other type of validation), but do not actually execute the update - // 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]; -} - -// 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - 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 (e.g. permission checks and - // any other type of validation), but do not actually execute the delete. - 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 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - 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 (e.g. permission checks and - // any other type of validation), but do not actually execute the delete. - 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. -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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating 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 (e.g. permission checks and - // any other type of validation), but do not actually execute the import - // 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating 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 (e.g. permission checks and - // any other type of validation), but do 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating 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 (e.g. permission checks and - // any other type of validation), but do 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating 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 - // processsing 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating 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 (e.g. permission checks and - // any other type of validation), but do not actually execute the update - // 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - 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 (e.g. permission checks and - // any other type of validation), but do not actually execute the delete. - 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation (e.g. permission checks and - // any other type of validation), but do not actually execute the failover. - 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation (e.g. permission checks and - // any other type of validation), but do not actually execute the fault - // injection. - 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, performs request validation (e.g. permission checks and - // any other type of validation), but do not actually execute the restart. - bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - 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; -} - -// 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - 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 - // ceritificate 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - 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. 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 [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 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - 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 requesting list of Databases. -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, an appropriate number of databases - // will be returned. The max value will be 2000, 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 response to listing Databases. -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/v1beta/protos/protos.d.ts b/owl-bot-staging/google-cloud-alloydb/v1beta/protos/protos.d.ts deleted file mode 100644 index 592d8296994..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/protos/protos.d.ts +++ /dev/null @@ -1,19466 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 v1beta. */ - namespace v1beta { - - /** 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 - } - - /** 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"); - - /** AutomatedBackupPolicy _enabled. */ - public _enabled?: "enabled"; - - /** - * 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); - - /** ContinuousBackupConfig _enabled. */ - public _enabled?: "enabled"; - - /** - * 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); - } - - /** 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[]; - - /** - * 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 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 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 maintenanceUpdatePolicy */ - maintenanceUpdatePolicy?: (google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy|null); - - /** Cluster maintenanceSchedule */ - maintenanceSchedule?: (google.cloud.alloydb.v1beta.IMaintenanceSchedule|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 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 maintenanceUpdatePolicy. */ - public maintenanceUpdatePolicy?: (google.cloud.alloydb.v1beta.IMaintenanceUpdatePolicy|null); - - /** Cluster maintenanceSchedule. */ - public maintenanceSchedule?: (google.cloud.alloydb.v1beta.IMaintenanceSchedule|null); - - /** Cluster source. */ - public source?: ("backupSource"|"migrationSource"); - - /** - * 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; - } - - /** 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 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 outboundPublicIpAddresses */ - outboundPublicIpAddresses?: (string[]|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 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 outboundPublicIpAddresses. */ - public outboundPublicIpAddresses: string[]; - - /** - * 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); - } - - /** 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; - - /** - * 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); - - /** QueryInsightsInstanceConfig _recordApplicationTags. */ - public _recordApplicationTags?: "recordApplicationTags"; - - /** QueryInsightsInstanceConfig _recordClientAddress. */ - public _recordClientAddress?: "recordClientAddress"; - - /** QueryInsightsInstanceConfig _queryPlansPerMinute. */ - public _queryPlansPerMinute?: "queryPlansPerMinute"; - - /** - * 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 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 consumerEndpointIps */ - consumerEndpointIps?: (string[]|null); - - /** PscInterfaceConfig networkAttachment */ - networkAttachment?: (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 consumerEndpointIps. */ - public consumerEndpointIps: string[]; - - /** PscInterfaceConfig networkAttachment. */ - public networkAttachment: 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 PscInstanceConfig. */ - interface IPscInstanceConfig { - - /** PscInstanceConfig serviceAttachmentLink */ - serviceAttachmentLink?: (string|null); - - /** PscInstanceConfig allowedConsumerProjects */ - allowedConsumerProjects?: (string[]|null); - - /** PscInstanceConfig allowedConsumerNetworks */ - allowedConsumerNetworks?: (string[]|null); - - /** PscInstanceConfig pscInterfaceConfigs */ - pscInterfaceConfigs?: (google.cloud.alloydb.v1beta.Instance.IPscInterfaceConfig[]|null); - - /** PscInstanceConfig outgoingServiceAttachmentLinks */ - outgoingServiceAttachmentLinks?: (string[]|null); - - /** PscInstanceConfig pscEnabled */ - pscEnabled?: (boolean|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 allowedConsumerNetworks. */ - public allowedConsumerNetworks: string[]; - - /** PscInstanceConfig pscInterfaceConfigs. */ - public pscInterfaceConfigs: google.cloud.alloydb.v1beta.Instance.IPscInterfaceConfig[]; - - /** PscInstanceConfig outgoingServiceAttachmentLinks. */ - public outgoingServiceAttachmentLinks: string[]; - - /** PscInstanceConfig pscEnabled. */ - public pscEnabled: boolean; - - /** - * 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); - } - - /** 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; - - /** - * 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; - } - } - - /** 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 - } - } - - /** 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 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); - } - - /** 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 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); - - /** - * 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 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); - } - - /** 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 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 restrictions. */ - public restrictions?: ("stringRestrictions"|"integerRestrictions"); - - /** - * 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 - } - } - - /** 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); - } - - /** 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); - - /** - * 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); - } - - /** 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; - - /** - * 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; - } - - /** 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 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 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 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; - } - - 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|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|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|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; - } - - /** 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 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 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); - } - - /** 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; - - /** - * 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 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); - } - - /** 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; - - /** - * 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 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 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"; - - /** - * 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 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; - } - } - } - } - - /** 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 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 - } - } - - /** 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 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 - } - } - - /** 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.fieldInfo */ - ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); - - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|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|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|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|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|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|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|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 { - - /** 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/v1beta/protos/protos.js b/owl-bot-staging/google-cloud-alloydb/v1beta/protos/protos.js deleted file mode 100644 index c1f35e20232..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/protos/protos.js +++ /dev/null @@ -1,50335 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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.v1beta = (function() { - - /** - * Namespace v1beta. - * @memberof google.cloud.alloydb - * @namespace - */ - var v1beta = {}; - - /** - * 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 - */ - 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; - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) - }); - - /** - * AutomatedBackupPolicy _enabled. - * @member {"enabled"|undefined} _enabled - * @memberof google.cloud.alloydb.v1beta.AutomatedBackupPolicy - * @instance - */ - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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; - - /** - * ContinuousBackupConfig _enabled. - * @member {"enabled"|undefined} _enabled - * @memberof google.cloud.alloydb.v1beta.ContinuousBackupConfig - * @instance - */ - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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 - */ - - /** - * 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 = []; - if (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; - - /** - * 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(); - 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) { - 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(); - 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; - } - 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; - } - } - 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]); - } - } - 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 = []; - 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); - } - 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) { - 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(); - 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; - })(); - - 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) { - 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(); - 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 {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.IMaintenanceUpdatePolicy|null} [maintenanceUpdatePolicy] Cluster maintenanceUpdatePolicy - * @property {google.cloud.alloydb.v1beta.IMaintenanceSchedule|null} [maintenanceSchedule] Cluster maintenanceSchedule - */ - - /** - * 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 = {}; - if (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 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 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; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Cluster source. - * @member {"backupSource"|"migrationSource"|undefined} source - * @memberof google.cloud.alloydb.v1beta.Cluster - * @instance - */ - Object.defineProperty(Cluster.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["backupSource", "migrationSource"]), - 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.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.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(); - 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) { - 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(); - 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 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 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; - } - 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.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: - 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.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; - } - 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.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; - } - 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.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); - } - 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 = {}; - } - 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.maintenanceUpdatePolicy = null; - object.maintenanceSchedule = 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.maintenanceUpdatePolicy != null && message.hasOwnProperty("maintenanceUpdatePolicy")) - object.maintenanceUpdatePolicy = $root.google.cloud.alloydb.v1beta.MaintenanceUpdatePolicy.toObject(message.maintenanceUpdatePolicy, options); - if (message.maintenanceSchedule != null && message.hasOwnProperty("maintenanceSchedule")) - object.maintenanceSchedule = $root.google.cloud.alloydb.v1beta.MaintenanceSchedule.toObject(message.maintenanceSchedule, 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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; - })(); - - /** - * 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.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 {Array.|null} [outboundPublicIpAddresses] Instance outboundPublicIpAddresses - */ - - /** - * 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 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 outboundPublicIpAddresses. - * @member {Array.} outboundPublicIpAddresses - * @memberof google.cloud.alloydb.v1beta.Instance - * @instance - */ - Instance.prototype.outboundPublicIpAddresses = $util.emptyArray; - - /** - * 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.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.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]); - 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) { - 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(); - 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 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 34: { - if (!(message.outboundPublicIpAddresses && message.outboundPublicIpAddresses.length)) - message.outboundPublicIpAddresses = []; - message.outboundPublicIpAddresses.push(reader.string()); - 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.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.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"; - } - 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.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.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]); - } - 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.publicIpAddress = ""; - object.pscInstanceConfig = null; - object.networkConfig = 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.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.outboundPublicIpAddresses && message.outboundPublicIpAddresses.length) { - object.outboundPublicIpAddresses = []; - for (var j = 0; j < message.outboundPublicIpAddresses.length; ++j) - object.outboundPublicIpAddresses[j] = message.outboundPublicIpAddresses[j]; - } - 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 - */ - - /** - * 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; - - /** - * 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); - 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.cpuCount = reader.int32(); - 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"; - 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; - 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; - if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) - object.cpuCount = message.cpuCount; - 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) { - 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(); - 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; - - /** - * QueryInsightsInstanceConfig _recordApplicationTags. - * @member {"recordApplicationTags"|undefined} _recordApplicationTags - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig - * @instance - */ - Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordApplicationTags", { - get: $util.oneOfGetter($oneOfFields = ["recordApplicationTags"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * QueryInsightsInstanceConfig _recordClientAddress. - * @member {"recordClientAddress"|undefined} _recordClientAddress - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig - * @instance - */ - Object.defineProperty(QueryInsightsInstanceConfig.prototype, "_recordClientAddress", { - get: $util.oneOfGetter($oneOfFields = ["recordClientAddress"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * QueryInsightsInstanceConfig _queryPlansPerMinute. - * @member {"queryPlansPerMinute"|undefined} _queryPlansPerMinute - * @memberof google.cloud.alloydb.v1beta.Instance.QueryInsightsInstanceConfig - * @instance - */ - 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) { - 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(); - 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.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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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 {Array.|null} [consumerEndpointIps] PscInterfaceConfig consumerEndpointIps - * @property {string|null} [networkAttachment] PscInterfaceConfig networkAttachment - */ - - /** - * 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) { - this.consumerEndpointIps = []; - if (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 consumerEndpointIps. - * @member {Array.} consumerEndpointIps - * @memberof google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig - * @instance - */ - PscInterfaceConfig.prototype.consumerEndpointIps = $util.emptyArray; - - /** - * PscInterfaceConfig networkAttachment. - * @member {string} networkAttachment - * @memberof google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig - * @instance - */ - PscInterfaceConfig.prototype.networkAttachment = ""; - - /** - * 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.consumerEndpointIps != null && message.consumerEndpointIps.length) - for (var i = 0; i < message.consumerEndpointIps.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.consumerEndpointIps[i]); - if (message.networkAttachment != null && Object.hasOwnProperty.call(message, "networkAttachment")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.networkAttachment); - 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) { - 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(); - switch (tag >>> 3) { - case 1: { - if (!(message.consumerEndpointIps && message.consumerEndpointIps.length)) - message.consumerEndpointIps = []; - message.consumerEndpointIps.push(reader.string()); - break; - } - case 2: { - message.networkAttachment = 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.consumerEndpointIps != null && message.hasOwnProperty("consumerEndpointIps")) { - if (!Array.isArray(message.consumerEndpointIps)) - return "consumerEndpointIps: array expected"; - for (var i = 0; i < message.consumerEndpointIps.length; ++i) - if (!$util.isString(message.consumerEndpointIps[i])) - return "consumerEndpointIps: string[] expected"; - } - if (message.networkAttachment != null && message.hasOwnProperty("networkAttachment")) - if (!$util.isString(message.networkAttachment)) - return "networkAttachment: 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.consumerEndpointIps) { - if (!Array.isArray(object.consumerEndpointIps)) - throw TypeError(".google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig.consumerEndpointIps: array expected"); - message.consumerEndpointIps = []; - for (var i = 0; i < object.consumerEndpointIps.length; ++i) - message.consumerEndpointIps[i] = String(object.consumerEndpointIps[i]); - } - if (object.networkAttachment != null) - message.networkAttachment = String(object.networkAttachment); - 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.arrays || options.defaults) - object.consumerEndpointIps = []; - if (options.defaults) - object.networkAttachment = ""; - if (message.consumerEndpointIps && message.consumerEndpointIps.length) { - object.consumerEndpointIps = []; - for (var j = 0; j < message.consumerEndpointIps.length; ++j) - object.consumerEndpointIps[j] = message.consumerEndpointIps[j]; - } - if (message.networkAttachment != null && message.hasOwnProperty("networkAttachment")) - object.networkAttachment = message.networkAttachment; - 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.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 {Array.|null} [allowedConsumerNetworks] PscInstanceConfig allowedConsumerNetworks - * @property {Array.|null} [pscInterfaceConfigs] PscInstanceConfig pscInterfaceConfigs - * @property {Array.|null} [outgoingServiceAttachmentLinks] PscInstanceConfig outgoingServiceAttachmentLinks - * @property {boolean|null} [pscEnabled] PscInstanceConfig pscEnabled - */ - - /** - * 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.allowedConsumerNetworks = []; - this.pscInterfaceConfigs = []; - this.outgoingServiceAttachmentLinks = []; - if (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 allowedConsumerNetworks. - * @member {Array.} allowedConsumerNetworks - * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig - * @instance - */ - PscInstanceConfig.prototype.allowedConsumerNetworks = $util.emptyArray; - - /** - * PscInstanceConfig pscInterfaceConfigs. - * @member {Array.} pscInterfaceConfigs - * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig - * @instance - */ - PscInstanceConfig.prototype.pscInterfaceConfigs = $util.emptyArray; - - /** - * PscInstanceConfig outgoingServiceAttachmentLinks. - * @member {Array.} outgoingServiceAttachmentLinks - * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig - * @instance - */ - PscInstanceConfig.prototype.outgoingServiceAttachmentLinks = $util.emptyArray; - - /** - * PscInstanceConfig pscEnabled. - * @member {boolean} pscEnabled - * @memberof google.cloud.alloydb.v1beta.Instance.PscInstanceConfig - * @instance - */ - PscInstanceConfig.prototype.pscEnabled = false; - - /** - * 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.allowedConsumerNetworks != null && message.allowedConsumerNetworks.length) - for (var i = 0; i < message.allowedConsumerNetworks.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.allowedConsumerNetworks[i]); - 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 4, wireType 2 =*/34).fork()).ldelim(); - if (message.outgoingServiceAttachmentLinks != null && message.outgoingServiceAttachmentLinks.length) - for (var i = 0; i < message.outgoingServiceAttachmentLinks.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.outgoingServiceAttachmentLinks[i]); - if (message.pscEnabled != null && Object.hasOwnProperty.call(message, "pscEnabled")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.pscEnabled); - 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) { - 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(); - 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 3: { - if (!(message.allowedConsumerNetworks && message.allowedConsumerNetworks.length)) - message.allowedConsumerNetworks = []; - message.allowedConsumerNetworks.push(reader.string()); - break; - } - case 4: { - if (!(message.pscInterfaceConfigs && message.pscInterfaceConfigs.length)) - message.pscInterfaceConfigs = []; - message.pscInterfaceConfigs.push($root.google.cloud.alloydb.v1beta.Instance.PscInterfaceConfig.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.outgoingServiceAttachmentLinks && message.outgoingServiceAttachmentLinks.length)) - message.outgoingServiceAttachmentLinks = []; - message.outgoingServiceAttachmentLinks.push(reader.string()); - break; - } - case 6: { - message.pscEnabled = reader.bool(); - 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.allowedConsumerNetworks != null && message.hasOwnProperty("allowedConsumerNetworks")) { - if (!Array.isArray(message.allowedConsumerNetworks)) - return "allowedConsumerNetworks: array expected"; - for (var i = 0; i < message.allowedConsumerNetworks.length; ++i) - if (!$util.isString(message.allowedConsumerNetworks[i])) - return "allowedConsumerNetworks: 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.outgoingServiceAttachmentLinks != null && message.hasOwnProperty("outgoingServiceAttachmentLinks")) { - if (!Array.isArray(message.outgoingServiceAttachmentLinks)) - return "outgoingServiceAttachmentLinks: array expected"; - for (var i = 0; i < message.outgoingServiceAttachmentLinks.length; ++i) - if (!$util.isString(message.outgoingServiceAttachmentLinks[i])) - return "outgoingServiceAttachmentLinks: string[] expected"; - } - if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) - if (typeof message.pscEnabled !== "boolean") - return "pscEnabled: boolean expected"; - 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.allowedConsumerNetworks) { - if (!Array.isArray(object.allowedConsumerNetworks)) - throw TypeError(".google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.allowedConsumerNetworks: array expected"); - message.allowedConsumerNetworks = []; - for (var i = 0; i < object.allowedConsumerNetworks.length; ++i) - message.allowedConsumerNetworks[i] = String(object.allowedConsumerNetworks[i]); - } - 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.outgoingServiceAttachmentLinks) { - if (!Array.isArray(object.outgoingServiceAttachmentLinks)) - throw TypeError(".google.cloud.alloydb.v1beta.Instance.PscInstanceConfig.outgoingServiceAttachmentLinks: array expected"); - message.outgoingServiceAttachmentLinks = []; - for (var i = 0; i < object.outgoingServiceAttachmentLinks.length; ++i) - message.outgoingServiceAttachmentLinks[i] = String(object.outgoingServiceAttachmentLinks[i]); - } - if (object.pscEnabled != null) - message.pscEnabled = Boolean(object.pscEnabled); - 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.allowedConsumerNetworks = []; - object.pscInterfaceConfigs = []; - object.outgoingServiceAttachmentLinks = []; - } - if (options.defaults) { - object.serviceAttachmentLink = ""; - object.pscEnabled = false; - } - 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.allowedConsumerNetworks && message.allowedConsumerNetworks.length) { - object.allowedConsumerNetworks = []; - for (var j = 0; j < message.allowedConsumerNetworks.length; ++j) - object.allowedConsumerNetworks[j] = message.allowedConsumerNetworks[j]; - } - 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.outgoingServiceAttachmentLinks && message.outgoingServiceAttachmentLinks.length) { - object.outgoingServiceAttachmentLinks = []; - for (var j = 0; j < message.outgoingServiceAttachmentLinks.length; ++j) - object.outgoingServiceAttachmentLinks[j] = message.outgoingServiceAttachmentLinks[j]; - } - if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) - object.pscEnabled = message.pscEnabled; - 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 - */ - - /** - * 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; - - /** - * 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); - 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) { - 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(); - 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; - } - 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"; - 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); - 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; - } - 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; - 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) { - 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(); - 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; - })(); - - /** - * 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; - })(); - - 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) { - 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(); - 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 {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 - */ - - /** - * 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 = {}; - if (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 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; - - /** - * 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); - 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) { - 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(); - 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 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; - } - 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.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: - break; - } - 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.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; - } - 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 = {}; - } - 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; - } - 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; - 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) { - 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(); - 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} [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 - */ - - /** - * 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 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; - - // 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) - }); - - /** - * 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(); - 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) { - 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(); - 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 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; - } - 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.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: - break; - } - } - if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) - if (typeof message.requiresDbRestart !== "boolean") - return "requiresDbRestart: boolean expected"; - 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.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; - } - } - if (object.requiresDbRestart != null) - message.requiresDbRestart = Boolean(object.requiresDbRestart); - 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; - } - 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"; - } - 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) { - 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(); - 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) { - 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(); - 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; - })(); - - 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 - */ - - /** - * 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; - - /** - * 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); - 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) { - 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(); - 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; - } - 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; - } - 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; - } - 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; - } - 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; - 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 - */ - - /** - * 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 = ""; - - /** - * 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); - 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.charset = reader.string(); - break; - } - case 3: { - message.collation = reader.string(); - 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"; - 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"; - 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); - 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 = ""; - } - 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; - 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; - })(); - - 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|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|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|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 - */ - - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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.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) { - 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(); - 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.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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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 - */ - - /** - * 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) { - if (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; - - /** - * 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); - 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) { - 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(); - 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 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"; - 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); - 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.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 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.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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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 - */ - - /** - * 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 = ""; - - /** - * 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); - 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.parent = 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 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"; - 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); - 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 = ""; - } - 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; - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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.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 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"|undefined} requestSpecific - * @memberof google.cloud.alloydb.v1beta.OperationMetadata - * @instance - */ - Object.defineProperty(OperationMetadata.prototype, "requestSpecific", { - get: $util.oneOfGetter($oneOfFields = ["batchCreateInstancesMetadata"]), - 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(); - 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) { - 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(); - switch (tag >>> 3) { - case 8: { - message.batchCreateInstancesMetadata = $root.google.cloud.alloydb.v1beta.BatchCreateInstancesMetadata.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.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.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"; - } - 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.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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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; - })(); - - 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.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) { - 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(); - 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; - })(); - - 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) { - 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(); - 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) { - 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(); - 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.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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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; - })(); - - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference - */ - - /** - * 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.fieldInfo. - * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldInfo"] = null; - - /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.resourceReference"] = 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) { - 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(); - 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 291403980: { - message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); - break; - } - case 1055: { - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.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.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; - } - 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; - } - 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.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"]); - } - 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"]); - } - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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 = {}; - - /** - * 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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) { - 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(); - 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/v1beta/protos/protos.json b/owl-bot-staging/google-cloud-alloydb/v1beta/protos/protos.json deleted file mode 100644 index ce207332807..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/protos/protos.json +++ /dev/null @@ -1,5788 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "cloud": { - "nested": { - "alloydb": { - "nested": { - "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": "ServiceProto", - "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/Network", - "(google.api.resource_definition).pattern": "projects/{project}/global/networks/{network}" - }, - "nested": { - "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 - } - }, - "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 - } - } - }, - "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 - } - }, - "nested": { - "MaintenanceWindow": { - "fields": { - "day": { - "type": "google.type.DayOfWeek", - "id": 1 - }, - "startTime": { - "type": "google.type.TimeOfDay", - "id": 2 - } - } - } - } - }, - "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).style": "DECLARATIVE_FRIENDLY" - }, - "oneofs": { - "source": { - "oneof": [ - "backupSource", - "migrationSource" - ] - } - }, - "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" - } - }, - "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" - } - }, - "maintenanceUpdatePolicy": { - "type": "MaintenanceUpdatePolicy", - "id": 32, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maintenanceSchedule": { - "type": "MaintenanceSchedule", - "id": 37, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "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 - } - } - }, - "PrimaryConfig": { - "fields": { - "secondaryClusterNames": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "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).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 - }, - "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" - } - }, - "outboundPublicIpAddresses": { - "rule": "repeated", - "type": "string", - "id": 34, - "options": { - "(google.api.field_info).format": "IPV4", - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "MachineConfig": { - "fields": { - "cpuCount": { - "type": "int32", - "id": 1 - } - } - }, - "Node": { - "fields": { - "zoneId": { - "type": "string", - "id": 1 - }, - "id": { - "type": "string", - "id": 2 - }, - "ip": { - "type": "string", - "id": 3 - }, - "state": { - "type": "string", - "id": 4 - } - } - }, - "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 - } - } - } - }, - "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": { - "consumerEndpointIps": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "networkAttachment": { - "type": "string", - "id": 2 - } - } - }, - "PscInstanceConfig": { - "fields": { - "serviceAttachmentLink": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "allowedConsumerProjects": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowedConsumerNetworks": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pscInterfaceConfigs": { - "rule": "repeated", - "type": "PscInterfaceConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "outgoingServiceAttachmentLinks": { - "rule": "repeated", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pscEnabled": { - "type": "bool", - "id": 6, - "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" - } - } - }, - "nested": { - "AuthorizedNetwork": { - "fields": { - "cidrRange": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_info).format": "IPV4" - } - } - } - } - } - }, - "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 - } - } - } - }, - "ConnectionInfo": { - "options": { - "(google.api.resource).type": "alloydb.googleapis.com/ConnectionInfo", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/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).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" - } - }, - "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" - } - } - }, - "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}" - }, - "oneofs": { - "restrictions": { - "oneof": [ - "stringRestrictions", - "integerRestrictions" - ] - } - }, - "fields": { - "stringRestrictions": { - "type": "StringRestrictions", - "id": 7 - }, - "integerRestrictions": { - "type": "IntegerRestrictions", - "id": 8 - }, - "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 - } - }, - "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 - } - } - } - }, - "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).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" - } - } - }, - "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" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "charset": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "collation": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "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" - } - } - ] - }, - "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" - } - } - ] - }, - "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" - } - } - ] - }, - "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" - } - ] - } - } - }, - "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" - } - } - } - }, - "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" - } - } - } - }, - "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" - } - } - } - }, - "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 - } - } - }, - "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" - ] - } - }, - "fields": { - "batchCreateInstancesMetadata": { - "type": "BatchCreateInstancesMetadata", - "id": 8, - "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" - } - } - } - }, - "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 - } - } - } - } - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api;api", - "java_multiple_files": true, - "java_outer_classname": "LaunchStageProto", - "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 - } - }, - "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 - } - } - } - }, - "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 - } - } - }, - "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 - } - } - } - }, - "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": { - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - } - }, - "Edition": { - "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": { - "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, - "options": { - "packed": false - } - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11, - "options": { - "packed": false - } - }, - "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": { - "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": { - "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": { - "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": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "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": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - } - }, - "MethodDescriptorProto": { - "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": { - "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": { - "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": { - "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, - "options": { - "packed": false - } - }, - "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": { - "fields": { - "features": { - "type": "FeatureSet", - "id": 1 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "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": { - "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": { - "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": { - "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": { - "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": { - "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": { - "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": { - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2 - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "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": { - "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", - "cc_enable_arenas": true - }, - "nested": { - "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/v1beta/samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js deleted file mode 100644 index d8fc36d7f61..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_backup.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_backup.js deleted file mode 100644 index bfd84364aa2..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_backup.js +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js deleted file mode 100644 index 774bf1e618c..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating 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 (e.g. permission checks and - * any other type of validation), but do 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_instance.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_instance.js deleted file mode 100644 index 485bab7b525..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_instance.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating 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 (e.g. permission checks and - * any other type of validation), but do 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js deleted file mode 100644 index 7798f3fd61e..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating 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 (e.g. permission checks and - * any other type of validation), but do 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js deleted file mode 100644 index b0a62b0c791..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating 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 (e.g. permission checks and - * any other type of validation), but do 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_user.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_user.js deleted file mode 100644 index dee7285ec6f..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.create_user.js +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_backup.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_backup.js deleted file mode 100644 index e90e06eb231..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_backup.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js deleted file mode 100644 index 5339ccaf0cd..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - */ - // 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_instance.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_instance.js deleted file mode 100644 index d08ed5167f5..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_instance.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - */ - // 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_user.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_user.js deleted file mode 100644 index 4d582ae4f05..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.delete_user.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.failover_instance.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.failover_instance.js deleted file mode 100644 index 63fd0ce8860..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.failover_instance.js +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. - */ - // 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js deleted file mode 100644 index c4793d7945a..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // 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 - * ceritificate 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_backup.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_backup.js deleted file mode 100644 index 4e313ddd5ac..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_backup.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js deleted file mode 100644 index 9bb9eea3641..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js deleted file mode 100644 index 8fb8d256642..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_instance.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_instance.js deleted file mode 100644 index 247327798bb..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_instance.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_user.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_user.js deleted file mode 100644 index 52d285c62e0..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.get_user.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js deleted file mode 100644 index 97a83843d6f..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the fault - * injection. - */ - // 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_backups.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_backups.js deleted file mode 100644 index 4e614c2c99e..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_backups.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_clusters.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_clusters.js deleted file mode 100644 index 6911145b5ff..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_clusters.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_databases.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_databases.js deleted file mode 100644 index 8b4761f54dd..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_databases.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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, an appropriate number of databases - * will be returned. The max value will be 2000, 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_instances.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_instances.js deleted file mode 100644 index 7a036b4ab31..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_instances.js +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js deleted file mode 100644 index faf32726570..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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' - - // 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_users.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_users.js deleted file mode 100644 index cb4109d0019..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.list_users.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js deleted file mode 100644 index 2cc0403f4da..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - */ - // 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.restart_instance.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.restart_instance.js deleted file mode 100644 index a90610044b4..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.restart_instance.js +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the restart. - */ - // const validateOnly = true - - // 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js deleted file mode 100644 index d8a544f72b0..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the import - * 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_backup.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_backup.js deleted file mode 100644 index c4a40d59cda..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_backup.js +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_cluster.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_cluster.js deleted file mode 100644 index af8fa63ca1c..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_cluster.js +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_instance.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_instance.js deleted file mode 100644 index 214f5eaba46..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_instance.js +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * 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/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_user.js b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_user.js deleted file mode 100644 index eab7e930b5a..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/alloy_d_b_admin.update_user.js +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating 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/v1beta/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json b/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json deleted file mode 100644 index 2318eab6e75..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json +++ /dev/null @@ -1,1691 +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_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": 84, - "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": 80, - "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_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": 80, - "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": 74, - "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": 74, - "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" - } - ], - "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_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": 69, - "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" - } - ], - "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" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/src/index.ts b/owl-bot-staging/google-cloud-alloydb/v1beta/src/index.ts deleted file mode 100644 index 437f399a07e..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 v1beta from './v1beta'; -const AlloyDBAdminClient = v1beta.AlloyDBAdminClient; -type AlloyDBAdminClient = v1beta.AlloyDBAdminClient; -export {v1beta, AlloyDBAdminClient}; -export default {v1beta, AlloyDBAdminClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/alloy_d_b_admin_client.ts b/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/alloy_d_b_admin_client.ts deleted file mode 100644 index 3b6f959d6d0..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/alloy_d_b_admin_client.ts +++ /dev/null @@ -1,5218 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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'); - -/** - * 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; - 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://developers.google.com/identity/protocols/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.protobuf.Root.fromJSON(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 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 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)), - 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)), - 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', 'deleteCluster', 'promoteCluster', 'restoreCluster', 'createSecondaryCluster', 'listInstances', 'getInstance', 'createInstance', 'createSecondaryInstance', 'batchCreateInstances', 'updateInstance', 'deleteInstance', 'failoverInstance', 'injectFault', 'restartInstance', '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.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(); - return this.innerApiCalls.getCluster(request, options, callback); - } -/** - * 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(); - return this.innerApiCalls.getInstance(request, options, callback); - } -/** - * 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(); - return this.innerApiCalls.getBackup(request, options, callback); - } -/** - * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @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 - * ceritificate 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(); - return this.innerApiCalls.generateClientCertificate(request, options, callback); - } -/** - * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @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(); - return this.innerApiCalls.getConnectionInfo(request, options, callback); - } -/** - * 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(); - return this.innerApiCalls.getUser(request, options, callback); - } -/** - * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate 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(); - return this.innerApiCalls.createUser(request, options, callback); - } -/** - * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate 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(); - return this.innerApiCalls.updateUser(request, options, callback); - } -/** - * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @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(); - return this.innerApiCalls.deleteUser(request, options, callback); - } - -/** - * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate 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 (e.g. permission checks and - * any other type of validation), but do 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(); - return this.innerApiCalls.createCluster(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * 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(); - return this.innerApiCalls.updateCluster(request, options, callback); - } -/** - * 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>{ - 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; - } -/** - * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @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 (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * @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(); - return this.innerApiCalls.deleteCluster(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @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 (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * @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(); - return this.innerApiCalls.promoteCluster(request, options, callback); - } -/** - * 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>{ - 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; - } -/** - * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the import - * 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(); - return this.innerApiCalls.restoreCluster(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate 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 (e.g. permission checks and - * any other type of validation), but do 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(); - return this.innerApiCalls.createSecondaryCluster(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate 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 (e.g. permission checks and - * any other type of validation), but do 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(); - return this.innerApiCalls.createInstance(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate 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 (e.g. permission checks and - * any other type of validation), but do 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(); - return this.innerApiCalls.createSecondaryInstance(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate 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(); - return this.innerApiCalls.batchCreateInstances(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * 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(); - return this.innerApiCalls.updateInstance(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @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 (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. - * @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(); - return this.innerApiCalls.deleteInstance(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {boolean} [request.validateOnly] - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. - * @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(); - return this.innerApiCalls.failoverInstance(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {boolean} [request.validateOnly] - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the fault - * injection. - * @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(); - return this.innerApiCalls.injectFault(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {boolean} [request.validateOnly] - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the restart. - * @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(); - return this.innerApiCalls.restartInstance(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate 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(); - return this.innerApiCalls.createBackup(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate 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(); - return this.innerApiCalls.updateBackup(request, options, callback); - } -/** - * 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>{ - 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @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(); - return this.innerApiCalls.deleteBackup(request, options, callback); - } -/** - * 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>{ - 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(); - return this.innerApiCalls.listClusters(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, 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(); - 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(); - 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(); - return this.innerApiCalls.listInstances(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, 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(); - 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(); - 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(); - return this.innerApiCalls.listBackups(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, 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(); - 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(); - 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 {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(); - return this.innerApiCalls.listSupportedDatabaseFlags(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, 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 {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(); - 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 {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(); - 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(); - return this.innerApiCalls.listUsers(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, 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(); - 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(); - 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, an appropriate number of databases - * will be returned. The max value will be 2000, 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(); - return this.innerApiCalls.listDatabases(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, 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, an appropriate number of databases - * will be returned. The max value will be 2000, 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(); - 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, an appropriate number of databases - * will be returned. The max value will be 2000, 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(); - 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, - options?: - | 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]> { - 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 { - 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, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - 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, - options?: - | 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 { - 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._terminated = true; - stub.close(); - this.iamClient.close(); - this.locationsClient.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/alloy_d_b_admin_client_config.json b/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/alloy_d_b_admin_client_config.json deleted file mode 100644 index b415f7b4a5a..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/alloy_d_b_admin_client_config.json +++ /dev/null @@ -1,198 +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" - }, - "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" - }, - "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" - }, - "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" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/alloy_d_b_admin_proto_list.json b/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/alloy_d_b_admin_proto_list.json deleted file mode 100644 index 301a66f45b1..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/alloy_d_b_admin_proto_list.json +++ /dev/null @@ -1,4 +0,0 @@ -[ - "../../protos/google/cloud/alloydb/v1beta/resources.proto", - "../../protos/google/cloud/alloydb/v1beta/service.proto" -] diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/gapic_metadata.json b/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/gapic_metadata.json deleted file mode 100644 index 8392ceb7a1c..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/gapic_metadata.json +++ /dev/null @@ -1,367 +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" - ] - }, - "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" - ] - }, - "DeleteCluster": { - "methods": [ - "deleteCluster" - ] - }, - "PromoteCluster": { - "methods": [ - "promoteCluster" - ] - }, - "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" - ] - }, - "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" - ] - }, - "DeleteCluster": { - "methods": [ - "deleteCluster" - ] - }, - "PromoteCluster": { - "methods": [ - "promoteCluster" - ] - }, - "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" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/index.ts b/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/index.ts deleted file mode 100644 index 93eec87dc06..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/src/v1beta/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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'; diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-alloydb/v1beta/system-test/fixtures/sample/src/index.js deleted file mode 100644 index f26aa8e2c06..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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(); -} - -main(); diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-alloydb/v1beta/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index bd7a760f403..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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} from '@google-cloud/alloydb'; - -// check that the client class type name can be used -function doStuffWithAlloyDBAdminClient(client: AlloyDBAdminClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const alloyDBAdminClient = new AlloyDBAdminClient(); - doStuffWithAlloyDBAdminClient(alloyDBAdminClient); -} - -main(); diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/system-test/install.ts b/owl-bot-staging/google-cloud-alloydb/v1beta/system-test/install.ts deleted file mode 100644 index fd5bfdc71d5..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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/v1beta/test/gapic_alloy_d_b_admin_v1beta.ts b/owl-bot-staging/google-cloud-alloydb/v1beta/test/gapic_alloy_d_b_admin_v1beta.ts deleted file mode 100644 index 1391ba3892c..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/test/gapic_alloy_d_b_admin_v1beta.ts +++ /dev/null @@ -1,6475 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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(); - assert(client.alloyDBAdminStub); - client.close().then(() => { - done(); - }); - }); - - 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(); - }); - }); - - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - await assert.rejects(client.getInstance(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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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(); - await assert.rejects(client.deleteUser(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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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('deleteCluster', () => { - it('invokes deleteCluster without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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('restoreCluster', () => { - it('invokes restoreCluster without error', async () => { - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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); - } - }); - }); - 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', - }); - 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', - }); - 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', - }); - 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); - } - }); - }); - 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', - }); - 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', - }); - 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', - }); - 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); - } - }); - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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', - }); - 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); - } - }); - }); - 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', - }); - 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); - } - }); - }); - 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', - }); - 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); - } - }); - }); - 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.ListOperationsResponse[] = []; - 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', - }); - 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.ListOperationsResponse[] = []; - 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', () => { - 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', - }); - 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', () => { - 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', - }); - 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', () => { - 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', - }); - 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', () => { - 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', - }); - 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', () => { - 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', - }); - 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', () => { - 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', - }); - 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', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new alloydbadminModule.v1beta.AlloyDBAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - 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', () => { - 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', - }); - 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', () => { - 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', - }); - 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/v1beta/tsconfig.json b/owl-bot-staging/google-cloud-alloydb/v1beta/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/google-cloud-alloydb/v1beta/webpack.config.js b/owl-bot-staging/google-cloud-alloydb/v1beta/webpack.config.js deleted file mode 100644 index ee88fe6afc1..00000000000 --- a/owl-bot-staging/google-cloud-alloydb/v1beta/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/README.md b/packages/google-cloud-alloydb/README.md index 4679c98493a..68556a0c891 100644 --- a/packages/google-cloud-alloydb/README.md +++ b/packages/google-cloud-alloydb/README.md @@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. 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 with a service account][auth] so you can access the +1. [Set up authentication][auth] so you can access the API from your local workstation. ### Installing the client library @@ -125,6 +125,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Alloy_d_b_admin.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_cluster.js,packages/google-cloud-alloydb/samples/README.md) | | Alloy_d_b_admin.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_instance.js,packages/google-cloud-alloydb/samples/README.md) | | Alloy_d_b_admin.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.execute_sql.js,packages/google-cloud-alloydb/samples/README.md) | | Alloy_d_b_admin.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.failover_instance.js,packages/google-cloud-alloydb/samples/README.md) | | Alloy_d_b_admin.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js,packages/google-cloud-alloydb/samples/README.md) | | Alloy_d_b_admin.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_backup.js,packages/google-cloud-alloydb/samples/README.md) | @@ -135,12 +136,14 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Alloy_d_b_admin.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js,packages/google-cloud-alloydb/samples/README.md) | | Alloy_d_b_admin.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_backups.js,packages/google-cloud-alloydb/samples/README.md) | | Alloy_d_b_admin.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_clusters.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_databases.js,packages/google-cloud-alloydb/samples/README.md) | | Alloy_d_b_admin.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_instances.js,packages/google-cloud-alloydb/samples/README.md) | | Alloy_d_b_admin.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js,packages/google-cloud-alloydb/samples/README.md) | | Alloy_d_b_admin.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_users.js,packages/google-cloud-alloydb/samples/README.md) | | Alloy_d_b_admin.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js,packages/google-cloud-alloydb/samples/README.md) | | Alloy_d_b_admin.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restart_instance.js,packages/google-cloud-alloydb/samples/README.md) | | Alloy_d_b_admin.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restore_cluster.js,packages/google-cloud-alloydb/samples/README.md) | +| Alloy_d_b_admin.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.switchover_cluster.js,packages/google-cloud-alloydb/samples/README.md) | | Alloy_d_b_admin.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_backup.js,packages/google-cloud-alloydb/samples/README.md) | | Alloy_d_b_admin.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_cluster.js,packages/google-cloud-alloydb/samples/README.md) | | Alloy_d_b_admin.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) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_instance.js,packages/google-cloud-alloydb/samples/README.md) | @@ -279,4 +282,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [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 +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local diff --git a/owl-bot-staging/google-cloud-alloydb/v1/protos/google/cloud/alloydb/v1/data_model.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/data_model.proto similarity index 100% rename from owl-bot-staging/google-cloud-alloydb/v1/protos/google/cloud/alloydb/v1/data_model.proto rename to packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/data_model.proto 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 5b7cf97502d..424baceef22 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 @@ -17,6 +17,7 @@ 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/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; @@ -83,6 +84,27 @@ enum DatabaseVersion { // 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; +} + +// 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 @@ -162,7 +184,7 @@ message EncryptionInfo { message SslConfig { // SSL mode options. enum SslMode { - // SSL mode not specified. Defaults to ENCRYPTED_ONLY. + // SSL mode is not specified. Defaults to ENCRYPTED_ONLY. SSL_MODE_UNSPECIFIED = 0; // SSL connections are optional. CA verification not enforced. @@ -174,7 +196,7 @@ message SslConfig { SSL_MODE_REQUIRE = 2 [deprecated = true]; // SSL connections are required. CA verification enforced. - // Clients must have certificates signed by a Cluster CA, e.g. via + // Clients must have certificates signed by a Cluster CA, for example, using // GenerateClientCertificate. SSL_MODE_VERIFY_CA = 3 [deprecated = true]; @@ -371,6 +393,33 @@ message ContinuousBackupSource { [(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; + } + + // Preferred windows to perform maintenance. Currently limited to 1. + repeated MaintenanceWindow maintenance_windows = 1; +} + +// 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. @@ -378,19 +427,21 @@ 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 { - // Required. The resource link for the VPC network in which cluster + // 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 + // `projects/{project_number}/global/networks/{network_id}`. This is // required to create a cluster. string network = 1 [ - (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = OPTIONAL, (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } @@ -424,6 +475,28 @@ message Cluster { [(google.api.field_behavior) = OUTPUT_ONLY]; } + // 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]; + } + + // 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; + } + // Cluster State enum State { // The state of the cluster is unknown. @@ -539,7 +612,7 @@ message Cluster { // 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 + // 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, @@ -603,6 +676,42 @@ message Cluster { // 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 + ]; } // An Instance is a computing unit that an end customer can connect to. @@ -611,6 +720,8 @@ 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 }; @@ -672,10 +783,50 @@ message Instance { // connections to the database. bool require_connectors = 1 [(google.api.field_behavior) = OPTIONAL]; - // Optional. SSL config option for this instance. + // Optional. SSL configuration option for this instance. SslConfig ssl_config = 2 [(google.api.field_behavior) = OPTIONAL]; } + // 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]; + + // 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]; + } + + // 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]; + } + // Instance State enum State { // The state of the instance is unknown. @@ -843,6 +994,14 @@ message 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 @@ -861,6 +1020,24 @@ message Instance { // 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 + ]; } // ConnectionInfo singleton resource. @@ -869,6 +1046,8 @@ 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.: @@ -881,6 +1060,14 @@ message ConnectionInfo { // 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]; } @@ -890,6 +1077,8 @@ 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 }; @@ -1045,11 +1234,26 @@ message Backup { 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, @@ -1061,6 +1265,8 @@ 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 @@ -1138,6 +1344,8 @@ 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 }; @@ -1167,4 +1375,33 @@ message User { // 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. 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]; + + // Optional. Collation for the database. + // Name of the custom or native collation for postgres. + // Example values include "C", "POSIX", etc + string collation = 3 [(google.api.field_behavior) = OPTIONAL]; } diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/service.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/service.proto index a3eba091f9f..ab73dc5ccde 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/service.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/service.proto @@ -19,7 +19,9 @@ 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"; @@ -116,6 +118,22 @@ service AlloyDBAdmin { }; } + // 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. @@ -284,6 +302,16 @@ service AlloyDBAdmin { }; } + // 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) = { @@ -410,6 +438,14 @@ service AlloyDBAdmin { }; 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 @@ -482,23 +518,23 @@ message CreateSecondaryClusterRequest { 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. + // request ID so that if you must retry your request, the server ignores the + // request if it has already been completed. The server guarantees that for at + // least 60 minutes since the first request. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents + // ID, the server can check if the original operation with the same request ID + // was received, and if so, ignores the second request. This prevents // clients from accidentally creating 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 (e.g. permission checks and - // any other type of validation), but do not actually execute the create - // request. + // 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]; } @@ -520,23 +556,23 @@ message CreateClusterRequest { 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. + // request ID so that if you must retry your request, the server ignores the + // request if it has already been completed. The server guarantees that for at + // least 60 minutes since the first request. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents + // ID, the server can check if the original operation with the same request ID + // was received, and if so, ignores the second request. This prevents // clients from accidentally creating 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 (e.g. permission checks and - // any other type of validation), but do not actually execute the create - // request. + // 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]; } @@ -554,23 +590,23 @@ message UpdateClusterRequest { 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. + // request ID so that if you must retry your request, the server ignores the + // request if it has already been completed. The server guarantees that for at + // least 60 minutes since the first request. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents + // ID, the server can check if the original operation with the same request ID + // was received, and if so, ignores the second request. This prevents // clients from accidentally creating 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 (e.g. permission checks and - // any other type of validation), but do not actually execute the update - // request. + // 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 @@ -588,14 +624,14 @@ message DeleteClusterRequest { ]; // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. + // request ID so that if you must retry your request, the server ignores the + // request if it has already been completed. The server guarantees that for at + // least 60 minutes since the first request. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents + // ID, the server can check if the original operation with the same request ID + // was received, and if so, ignores the second request. This prevents // clients from accidentally creating duplicate commitments. // // The request ID must be a valid UUID with the exception that zero UUID is @@ -607,14 +643,45 @@ message DeleteClusterRequest { // 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 (e.g. permission checks and - // any other type of validation), but do not actually execute the delete. + // 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 @@ -625,9 +692,9 @@ message PromoteClusterRequest { ]; // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. + // request ID so that if you must retry your request, the server ignores the + // request if it has already been completed. The server guarantees that for at + // least 60 minutes since the first request. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request @@ -644,8 +711,9 @@ message PromoteClusterRequest { // 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 (e.g. permission checks and - // any other type of validation), but do not actually execute the delete. + // 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]; } @@ -679,23 +747,23 @@ message RestoreClusterRequest { 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. + // request ID so that if you must retry your request, the server ignores the + // request if it has already been completed. The server guarantees that for at + // least 60 minutes since the first request. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents + // ID, the server can check if the original operation with the same request ID + // was received, and if so, ignores the second request. This prevents // clients from accidentally creating 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 (e.g. permission checks and - // any other type of validation), but do not actually execute the import - // request. + // 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]; } @@ -773,23 +841,23 @@ message CreateInstanceRequest { 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. + // request ID so that if you must retry your request, the server ignores the + // request if it has already been completed. The server guarantees that for at + // least 60 minutes since the first request. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents + // ID, the server can check if the original operation with the same request ID + // was received, and if so, ignores the second request. This prevents // clients from accidentally creating 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 (e.g. permission checks and - // any other type of validation), but do not actually execute the create - // request. + // 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]; } @@ -811,23 +879,23 @@ message CreateSecondaryInstanceRequest { 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. + // request ID so that if you must retry your request, the server ignores the + // request if it has already been completed. The server guarantees that for at + // least 60 minutes since the first request. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents + // ID, the server can check if the original operation with the same request ID + // was received, and if so, ignores the second request. This prevents // clients from accidentally creating 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 (e.g. permission checks and - // any other type of validation), but do not actually execute the create - // request. + // 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]; } @@ -853,14 +921,14 @@ message BatchCreateInstancesRequest { 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. + // request ID so that if you must retry your request, the server ignores the + // request if it has already been completed. The server guarantees that for at + // least 60 minutes since the first request. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents + // ID, the server can check if the original operation with the same request ID + // was received, and if so, ignores the second request. This prevents // clients from accidentally creating duplicate commitments. // // The request ID must be a valid UUID with the exception that zero UUID is @@ -916,7 +984,7 @@ message BatchCreateInstanceStatus { STATE_UNSPECIFIED = 0; // Instance is pending creation and has not yet been picked up for - // processsing in the backend. + // processing in the backend. PENDING_CREATE = 1; // The instance is active and running. @@ -972,23 +1040,23 @@ message UpdateInstanceRequest { 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. + // request ID so that if you must retry your request, the server ignores the + // request if it has already been completed. The server guarantees that for at + // least 60 minutes since the first request. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents + // ID, the server can check if the original operation with the same request ID + // was received, and if so, ignores the second request. This prevents // clients from accidentally creating 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 (e.g. permission checks and - // any other type of validation), but do not actually execute the update - // request. + // 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 @@ -1008,14 +1076,14 @@ message DeleteInstanceRequest { ]; // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. + // request ID so that if you must retry your request, the server ignores the + // request if it has already been completed. The server guarantees that for at + // least 60 minutes since the first request. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents + // ID, the server can check if the original operation with the same request ID + // was received, and if so, ignores the second request. This prevents // clients from accidentally creating duplicate commitments. // // The request ID must be a valid UUID with the exception that zero UUID is @@ -1027,8 +1095,9 @@ message DeleteInstanceRequest { // 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 (e.g. permission checks and - // any other type of validation), but do not actually execute the delete. + // 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]; } @@ -1044,22 +1113,23 @@ message FailoverInstanceRequest { ]; // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. + // request ID so that if you must retry your request, the server ignores the + // request if it has already been completed. The server guarantees that for at + // least 60 minutes since the first request. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents + // ID, the server can check if the original operation with the same request ID + // was received, and if so, ignores the second request. This prevents // clients from accidentally creating 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 (e.g. permission checks and - // any other type of validation), but do not actually execute the failover. + // 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]; } @@ -1088,23 +1158,23 @@ message InjectFaultRequest { ]; // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. + // request ID so that if you must retry your request, the server ignores the + // request if it has already been completed. The server guarantees that for at + // least 60 minutes since the first request. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents + // ID, the server can check if the original operation with the same request ID + // was received, and if so, ignores the second request. This prevents // clients from accidentally creating 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 (e.g. permission checks and - // any other type of validation), but do not actually execute the fault - // injection. + // 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]; } @@ -1119,23 +1189,113 @@ message RestartInstanceRequest { ]; // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. + // request ID so that if you must retry your request, the server ignores the + // request if it has already been completed. The server guarantees that for at + // least 60 minutes since the first request. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents + // ID, the server can check if the original operation with the same request ID + // was received, and if so, ignores the second request. This prevents // clients from accidentally creating 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 (e.g. permission checks and - // any other type of validation), but do not actually execute the restart. + // 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]; +} + +// 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 @@ -1200,14 +1360,14 @@ message CreateBackupRequest { 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. + // request ID so that if you must retry your request, the server ignores the + // request if it has already been completed. The server guarantees that for at + // least 60 minutes since the first request. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents + // ID, the server can check if the original operation with the same request ID + // was received, and if so, ignores the second request. This prevents // clients from accidentally creating duplicate commitments. // // The request ID must be a valid UUID with the exception that zero UUID is @@ -1233,14 +1393,14 @@ message UpdateBackupRequest { 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. + // request ID so that if you must retry your request, the server ignores the + // request if it has already been completed. The server guarantees that for at + // least 60 minutes since the first request. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents + // ID, the server can check if the original operation with the same request ID + // was received, and if so, ignores the second request. This prevents // clients from accidentally creating duplicate commitments. // // The request ID must be a valid UUID with the exception that zero UUID is @@ -1266,14 +1426,14 @@ message DeleteBackupRequest { ]; // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. + // request ID so that if you must retry your request, the server ignores the + // request if it has already been completed. The server guarantees that for at + // least 60 minutes since the first request. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents + // ID, the server can check if the original operation with the same request ID + // was received, and if so, ignores the second request. This prevents // clients from accidentally creating duplicate commitments. // // The request ID must be a valid UUID with the exception that zero UUID is @@ -1334,14 +1494,14 @@ message GenerateClientCertificateRequest { ]; // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. + // request ID so that if you must retry your request, the server ignores the + // request if it has already been completed. The server guarantees that for at + // least 60 minutes since the first request. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents + // ID, the server can check if the original operation with the same request ID + // was received, and if so, ignores the second request. This prevents // clients from accidentally creating duplicate commitments. // // The request ID must be a valid UUID with the exception that zero UUID is @@ -1388,14 +1548,14 @@ message GetConnectionInfoRequest { ]; // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. + // request ID so that if you must retry your request, the server ignores the + // request if it has already been completed. The server guarantees that for at + // least 60 minutes since the first request. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents + // ID, the server can check if the original operation with the same request ID + // was received, and if so, ignores the second request. This prevents // clients from accidentally creating duplicate commitments. // // The request ID must be a valid UUID with the exception that zero UUID is @@ -1503,14 +1663,14 @@ message CreateUserRequest { 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. + // request ID so that if you must retry your request, the server ignores the + // request if it has already been completed. The server guarantees that for at + // least 60 minutes since the first request. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents + // ID, the server can check if the original operation with the same request ID + // was received, and if so, ignores the second request. This prevents // clients from accidentally creating duplicate commitments. // // The request ID must be a valid UUID with the exception that zero UUID is @@ -1536,14 +1696,14 @@ message UpdateUserRequest { 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 will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. + // request ID so that if you must retry your request, the server ignores the + // request if it has already been completed. The server guarantees that for at + // least 60 minutes since the first request. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents + // ID, the server can check if the original operation with the same request ID + // was received, and if so, ignores the second request. This prevents // clients from accidentally creating duplicate commitments. // // The request ID must be a valid UUID with the exception that zero UUID is @@ -1568,14 +1728,14 @@ message DeleteUserRequest { ]; // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. + // request ID so that if you must retry your request, the server ignores the + // request if it has already been completed. The server guarantees that for at + // least 60 minutes since the first request. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents + // ID, the server can check if the original operation with the same request ID + // was received, and if so, ignores the second request. This prevents // clients from accidentally creating duplicate commitments. // // The request ID must be a valid UUID with the exception that zero UUID is @@ -1586,3 +1746,39 @@ message DeleteUserRequest { // execute it. bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; } + +// Message for requesting list of Databases. +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 response to listing Databases. +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/packages/google-cloud-alloydb/protos/protos.d.ts b/packages/google-cloud-alloydb/protos/protos.d.ts index 293dc297929..bd78d7f9078 100644 --- a/packages/google-cloud-alloydb/protos/protos.d.ts +++ b/packages/google-cloud-alloydb/protos/protos.d.ts @@ -26,6 +26,418 @@ export namespace google { /** Namespace v1. */ namespace v1 { + /** 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); + + /** SqlResultValue _value. */ + public _value?: "value"; + + /** SqlResultValue _nullValue. */ + public _nullValue?: "nullValue"; + + /** + * 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; + } + /** InstanceView enum. */ enum InstanceView { INSTANCE_VIEW_UNSPECIFIED = 0, @@ -44,7 +456,16 @@ export namespace google { enum DatabaseVersion { DATABASE_VERSION_UNSPECIFIED = 0, POSTGRES_13 = 1, - POSTGRES_14 = 2 + POSTGRES_14 = 2, + POSTGRES_15 = 3, + POSTGRES_16 = 4 + } + + /** SubscriptionType enum. */ + enum SubscriptionType { + SUBSCRIPTION_TYPE_UNSPECIFIED = 0, + STANDARD = 1, + TRIAL = 2 } /** Properties of a UserPassword. */ @@ -1481,6 +1902,306 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a MaintenanceUpdatePolicy. */ + interface IMaintenanceUpdatePolicy { + + /** MaintenanceUpdatePolicy maintenanceWindows */ + maintenanceWindows?: (google.cloud.alloydb.v1.MaintenanceUpdatePolicy.IMaintenanceWindow[]|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[]; + + /** + * 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 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 { @@ -1561,6 +2282,27 @@ export namespace google { /** 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); } /** Represents a Cluster. */ @@ -1650,6 +2392,27 @@ export namespace google { /** 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 source. */ public source?: ("backupSource"|"migrationSource"); @@ -2030,6 +2793,218 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a PscConfig. */ + interface IPscConfig { + + /** PscConfig pscEnabled */ + pscEnabled?: (boolean|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; + + /** + * 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; + } + /** State enum. */ enum State { STATE_UNSPECIFIED = 0, @@ -2109,6 +3084,9 @@ export namespace google { /** Instance ipAddress */ ipAddress?: (string|null); + /** Instance publicIpAddress */ + publicIpAddress?: (string|null); + /** Instance reconciling */ reconciling?: (boolean|null); @@ -2120,6 +3098,18 @@ export namespace google { /** 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); } /** Represents an Instance. */ @@ -2185,6 +3175,9 @@ export namespace google { /** Instance ipAddress. */ public ipAddress: string; + /** Instance publicIpAddress. */ + public publicIpAddress: string; + /** Instance reconciling. */ public reconciling: boolean; @@ -2197,6 +3190,18 @@ export namespace google { /** 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[]; + /** * Creates a new Instance instance using the specified properties. * @param [properties] Properties to set @@ -2813,6 +3818,324 @@ export namespace google { 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); + } + + /** 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; + + /** + * 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); + } + + /** 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; + + /** + * 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; + } + } + /** State enum. */ enum State { STATE_UNSPECIFIED = 0, @@ -2851,6 +4174,9 @@ export namespace google { /** ConnectionInfo ipAddress */ ipAddress?: (string|null); + /** ConnectionInfo publicIpAddress */ + publicIpAddress?: (string|null); + /** ConnectionInfo instanceUid */ instanceUid?: (string|null); } @@ -2870,6 +4196,9 @@ export namespace google { /** ConnectionInfo ipAddress. */ public ipAddress: string; + /** ConnectionInfo publicIpAddress. */ + public publicIpAddress: string; + /** ConnectionInfo instanceUid. */ public instanceUid: string; @@ -3014,8 +4343,14 @@ export namespace google { /** 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. */ @@ -3087,9 +4422,15 @@ export namespace google { /** 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 @@ -3659,6 +5000,9 @@ export namespace google { /** 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. */ @@ -3682,6 +5026,9 @@ export namespace google { /** 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 @@ -3770,6 +5117,115 @@ export namespace google { } } + /** Properties of a Database. */ + interface IDatabase { + + /** Database name */ + name?: (string|null); + + /** Database charset */ + charset?: (string|null); + + /** Database collation */ + collation?: (string|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; + + /** + * 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 { @@ -3874,6 +5330,20 @@ export namespace google { */ 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 @@ -4042,6 +5512,20 @@ export namespace google { */ 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 @@ -4223,6 +5707,20 @@ export namespace google { * @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 { @@ -4269,6 +5767,13 @@ export namespace google { */ 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 @@ -4353,6 +5858,13 @@ export namespace google { */ 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 @@ -4443,6 +5955,13 @@ export namespace google { * @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. */ @@ -5262,6 +6781,115 @@ export namespace google { 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 { @@ -7103,6 +8731,9 @@ export namespace google { /** RestartInstanceRequest validateOnly */ validateOnly?: (boolean|null); + + /** RestartInstanceRequest nodeIds */ + nodeIds?: (string[]|null); } /** Represents a RestartInstanceRequest. */ @@ -7123,6 +8754,9 @@ export namespace google { /** RestartInstanceRequest validateOnly. */ public validateOnly: boolean; + /** RestartInstanceRequest nodeIds. */ + public nodeIds: string[]; + /** * Creates a new RestartInstanceRequest instance using the specified properties. * @param [properties] Properties to set @@ -7201,6 +8835,359 @@ export namespace google { 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); + } + + /** 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 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 { @@ -9243,6 +11230,224 @@ export namespace google { */ 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; + } } /** Namespace v1alpha. */ @@ -30074,6 +32279,115 @@ export namespace google { IDENTIFIER = 8 } + /** 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 + } + } + /** Properties of a ResourceDescriptor. */ interface IResourceDescriptor { @@ -32172,115 +34486,6 @@ export namespace google { GA = 4, DEPRECATED = 5 } - - /** 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. */ @@ -34453,11 +36658,11 @@ export namespace google { /** 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); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); } /** Represents a FieldOptions. */ diff --git a/packages/google-cloud-alloydb/protos/protos.js b/packages/google-cloud-alloydb/protos/protos.js index dba34735200..2db16364f7a 100644 --- a/packages/google-cloud-alloydb/protos/protos.js +++ b/packages/google-cloud-alloydb/protos/protos.js @@ -66,73 +66,27 @@ */ var v1 = {}; - /** - * 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 - */ - 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; - return values; - })(); - - v1.UserPassword = (function() { + v1.SqlResult = (function() { /** - * Properties of a UserPassword. + * Properties of a SqlResult. * @memberof google.cloud.alloydb.v1 - * @interface IUserPassword - * @property {string|null} [user] UserPassword user - * @property {string|null} [password] UserPassword password + * @interface ISqlResult + * @property {Array.|null} [columns] SqlResult columns + * @property {Array.|null} [rows] SqlResult rows */ /** - * Constructs a new UserPassword. + * Constructs a new SqlResult. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a UserPassword. - * @implements IUserPassword + * @classdesc Represents a SqlResult. + * @implements ISqlResult * @constructor - * @param {google.cloud.alloydb.v1.IUserPassword=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.ISqlResult=} [properties] Properties to set */ - function UserPassword(properties) { + 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) @@ -140,89 +94,95 @@ } /** - * UserPassword user. - * @member {string} user - * @memberof google.cloud.alloydb.v1.UserPassword + * SqlResult columns. + * @member {Array.} columns + * @memberof google.cloud.alloydb.v1.SqlResult * @instance */ - UserPassword.prototype.user = ""; + SqlResult.prototype.columns = $util.emptyArray; /** - * UserPassword password. - * @member {string} password - * @memberof google.cloud.alloydb.v1.UserPassword + * SqlResult rows. + * @member {Array.} rows + * @memberof google.cloud.alloydb.v1.SqlResult * @instance */ - UserPassword.prototype.password = ""; + SqlResult.prototype.rows = $util.emptyArray; /** - * Creates a new UserPassword instance using the specified properties. + * Creates a new SqlResult instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.UserPassword + * @memberof google.cloud.alloydb.v1.SqlResult * @static - * @param {google.cloud.alloydb.v1.IUserPassword=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.UserPassword} UserPassword instance + * @param {google.cloud.alloydb.v1.ISqlResult=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.SqlResult} SqlResult instance */ - UserPassword.create = function create(properties) { - return new UserPassword(properties); + SqlResult.create = function create(properties) { + return new SqlResult(properties); }; /** - * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.alloydb.v1.UserPassword.verify|verify} messages. + * Encodes the specified SqlResult message. Does not implicitly {@link google.cloud.alloydb.v1.SqlResult.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.UserPassword + * @memberof google.cloud.alloydb.v1.SqlResult * @static - * @param {google.cloud.alloydb.v1.IUserPassword} message UserPassword message or plain object to encode + * @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 */ - UserPassword.encode = function encode(message, writer) { + SqlResult.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); + 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 UserPassword message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UserPassword.verify|verify} messages. + * 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.UserPassword + * @memberof google.cloud.alloydb.v1.SqlResult * @static - * @param {google.cloud.alloydb.v1.IUserPassword} message UserPassword message or plain object to encode + * @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 */ - UserPassword.encodeDelimited = function encodeDelimited(message, writer) { + SqlResult.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a UserPassword message from the specified reader or buffer. + * Decodes a SqlResult message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.UserPassword + * @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.UserPassword} UserPassword + * @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 */ - UserPassword.decode = function decode(reader, length) { + SqlResult.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: { - message.user = reader.string(); + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push($root.google.cloud.alloydb.v1.SqlResultColumn.decode(reader, reader.uint32())); break; } case 2: { - message.password = reader.string(); + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.google.cloud.alloydb.v1.SqlResultRow.decode(reader, reader.uint32())); break; } default: @@ -234,133 +194,166 @@ }; /** - * Decodes a UserPassword message from the specified reader or buffer, length delimited. + * Decodes a SqlResult message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.UserPassword + * @memberof google.cloud.alloydb.v1.SqlResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.UserPassword} UserPassword + * @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 */ - UserPassword.decodeDelimited = function decodeDelimited(reader) { + SqlResult.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a UserPassword message. + * Verifies a SqlResult message. * @function verify - * @memberof google.cloud.alloydb.v1.UserPassword + * @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 */ - UserPassword.verify = function verify(message) { + SqlResult.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"; + 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 UserPassword message from a plain object. Also converts values to their respective internal types. + * Creates a SqlResult message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.UserPassword + * @memberof google.cloud.alloydb.v1.SqlResult * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.UserPassword} UserPassword + * @returns {google.cloud.alloydb.v1.SqlResult} SqlResult */ - UserPassword.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.UserPassword) + SqlResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.SqlResult) 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); + 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 UserPassword message. Also converts values to other types if specified. + * Creates a plain object from a SqlResult message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.UserPassword + * @memberof google.cloud.alloydb.v1.SqlResult * @static - * @param {google.cloud.alloydb.v1.UserPassword} message UserPassword + * @param {google.cloud.alloydb.v1.SqlResult} message SqlResult * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UserPassword.toObject = function toObject(message, options) { + SqlResult.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.user = ""; - object.password = ""; + 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); } - 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. + * Converts this SqlResult to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.UserPassword + * @memberof google.cloud.alloydb.v1.SqlResult * @instance * @returns {Object.} JSON object */ - UserPassword.prototype.toJSON = function toJSON() { + SqlResult.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UserPassword + * Gets the default type url for SqlResult * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.UserPassword + * @memberof google.cloud.alloydb.v1.SqlResult * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UserPassword.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SqlResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.UserPassword"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.SqlResult"; }; - return UserPassword; + return SqlResult; })(); - v1.MigrationSource = (function() { + v1.SqlResultColumn = (function() { /** - * Properties of a MigrationSource. + * Properties of a SqlResultColumn. * @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 + * @interface ISqlResultColumn + * @property {string|null} [name] SqlResultColumn name + * @property {string|null} [type] SqlResultColumn type */ /** - * Constructs a new MigrationSource. + * Constructs a new SqlResultColumn. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a MigrationSource. - * @implements IMigrationSource + * @classdesc Represents a SqlResultColumn. + * @implements ISqlResultColumn * @constructor - * @param {google.cloud.alloydb.v1.IMigrationSource=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.ISqlResultColumn=} [properties] Properties to set */ - function MigrationSource(properties) { + function SqlResultColumn(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -368,103 +361,89 @@ } /** - * 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 + * SqlResultColumn name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.SqlResultColumn * @instance */ - MigrationSource.prototype.referenceId = ""; + SqlResultColumn.prototype.name = ""; /** - * MigrationSource sourceType. - * @member {google.cloud.alloydb.v1.MigrationSource.MigrationSourceType} sourceType - * @memberof google.cloud.alloydb.v1.MigrationSource + * SqlResultColumn type. + * @member {string} type + * @memberof google.cloud.alloydb.v1.SqlResultColumn * @instance */ - MigrationSource.prototype.sourceType = 0; + SqlResultColumn.prototype.type = ""; /** - * Creates a new MigrationSource instance using the specified properties. + * Creates a new SqlResultColumn instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.MigrationSource + * @memberof google.cloud.alloydb.v1.SqlResultColumn * @static - * @param {google.cloud.alloydb.v1.IMigrationSource=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.MigrationSource} MigrationSource instance + * @param {google.cloud.alloydb.v1.ISqlResultColumn=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.SqlResultColumn} SqlResultColumn instance */ - MigrationSource.create = function create(properties) { - return new MigrationSource(properties); + SqlResultColumn.create = function create(properties) { + return new SqlResultColumn(properties); }; /** - * Encodes the specified MigrationSource message. Does not implicitly {@link google.cloud.alloydb.v1.MigrationSource.verify|verify} messages. + * Encodes the specified SqlResultColumn message. Does not implicitly {@link google.cloud.alloydb.v1.SqlResultColumn.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.MigrationSource + * @memberof google.cloud.alloydb.v1.SqlResultColumn * @static - * @param {google.cloud.alloydb.v1.IMigrationSource} message MigrationSource message or plain object to encode + * @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 */ - MigrationSource.encode = function encode(message, writer) { + SqlResultColumn.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); + 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 MigrationSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.MigrationSource.verify|verify} messages. + * 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.MigrationSource + * @memberof google.cloud.alloydb.v1.SqlResultColumn * @static - * @param {google.cloud.alloydb.v1.IMigrationSource} message MigrationSource message or plain object to encode + * @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 */ - MigrationSource.encodeDelimited = function encodeDelimited(message, writer) { + SqlResultColumn.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MigrationSource message from the specified reader or buffer. + * Decodes a SqlResultColumn message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.MigrationSource + * @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.MigrationSource} MigrationSource + * @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 */ - MigrationSource.decode = function decode(reader, length) { + SqlResultColumn.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: { - message.hostPort = reader.string(); + message.name = reader.string(); break; } case 2: { - message.referenceId = reader.string(); - break; - } - case 3: { - message.sourceType = reader.int32(); + message.type = reader.string(); break; } default: @@ -476,172 +455,132 @@ }; /** - * Decodes a MigrationSource message from the specified reader or buffer, length delimited. + * Decodes a SqlResultColumn message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.MigrationSource + * @memberof google.cloud.alloydb.v1.SqlResultColumn * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.MigrationSource} MigrationSource + * @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 */ - MigrationSource.decodeDelimited = function decodeDelimited(reader) { + SqlResultColumn.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MigrationSource message. + * Verifies a SqlResultColumn message. * @function verify - * @memberof google.cloud.alloydb.v1.MigrationSource + * @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 */ - MigrationSource.verify = function verify(message) { + SqlResultColumn.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; - } + 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 MigrationSource message from a plain object. Also converts values to their respective internal types. + * Creates a SqlResultColumn message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.MigrationSource + * @memberof google.cloud.alloydb.v1.SqlResultColumn * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.MigrationSource} MigrationSource + * @returns {google.cloud.alloydb.v1.SqlResultColumn} SqlResultColumn */ - MigrationSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.MigrationSource) + SqlResultColumn.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.SqlResultColumn) 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; - } + 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 MigrationSource message. Also converts values to other types if specified. + * Creates a plain object from a SqlResultColumn message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.MigrationSource + * @memberof google.cloud.alloydb.v1.SqlResultColumn * @static - * @param {google.cloud.alloydb.v1.MigrationSource} message MigrationSource + * @param {google.cloud.alloydb.v1.SqlResultColumn} message SqlResultColumn * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MigrationSource.toObject = function toObject(message, options) { + SqlResultColumn.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; + object.name = ""; + object.type = ""; } - 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; + 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 MigrationSource to JSON. + * Converts this SqlResultColumn to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.MigrationSource + * @memberof google.cloud.alloydb.v1.SqlResultColumn * @instance * @returns {Object.} JSON object */ - MigrationSource.prototype.toJSON = function toJSON() { + SqlResultColumn.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MigrationSource + * Gets the default type url for SqlResultColumn * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.MigrationSource + * @memberof google.cloud.alloydb.v1.SqlResultColumn * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MigrationSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SqlResultColumn.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.MigrationSource"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.SqlResultColumn"; }; - /** - * 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; + return SqlResultColumn; })(); - v1.EncryptionConfig = (function() { + v1.SqlResultRow = (function() { /** - * Properties of an EncryptionConfig. + * Properties of a SqlResultRow. * @memberof google.cloud.alloydb.v1 - * @interface IEncryptionConfig - * @property {string|null} [kmsKeyName] EncryptionConfig kmsKeyName + * @interface ISqlResultRow + * @property {Array.|null} [values] SqlResultRow values */ /** - * Constructs a new EncryptionConfig. + * Constructs a new SqlResultRow. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an EncryptionConfig. - * @implements IEncryptionConfig + * @classdesc Represents a SqlResultRow. + * @implements ISqlResultRow * @constructor - * @param {google.cloud.alloydb.v1.IEncryptionConfig=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.ISqlResultRow=} [properties] Properties to set */ - function EncryptionConfig(properties) { + function SqlResultRow(properties) { + this.values = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -649,75 +588,78 @@ } /** - * EncryptionConfig kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.cloud.alloydb.v1.EncryptionConfig + * SqlResultRow values. + * @member {Array.} values + * @memberof google.cloud.alloydb.v1.SqlResultRow * @instance */ - EncryptionConfig.prototype.kmsKeyName = ""; + SqlResultRow.prototype.values = $util.emptyArray; /** - * Creates a new EncryptionConfig instance using the specified properties. + * Creates a new SqlResultRow instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.EncryptionConfig + * @memberof google.cloud.alloydb.v1.SqlResultRow * @static - * @param {google.cloud.alloydb.v1.IEncryptionConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.EncryptionConfig} EncryptionConfig instance + * @param {google.cloud.alloydb.v1.ISqlResultRow=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.SqlResultRow} SqlResultRow instance */ - EncryptionConfig.create = function create(properties) { - return new EncryptionConfig(properties); + SqlResultRow.create = function create(properties) { + return new SqlResultRow(properties); }; /** - * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.alloydb.v1.EncryptionConfig.verify|verify} messages. + * Encodes the specified SqlResultRow message. Does not implicitly {@link google.cloud.alloydb.v1.SqlResultRow.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.EncryptionConfig + * @memberof google.cloud.alloydb.v1.SqlResultRow * @static - * @param {google.cloud.alloydb.v1.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @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 */ - EncryptionConfig.encode = function encode(message, writer) { + SqlResultRow.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); + 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 EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.EncryptionConfig.verify|verify} messages. + * 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.EncryptionConfig + * @memberof google.cloud.alloydb.v1.SqlResultRow * @static - * @param {google.cloud.alloydb.v1.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @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 */ - EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + SqlResultRow.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EncryptionConfig message from the specified reader or buffer. + * Decodes a SqlResultRow message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.EncryptionConfig + * @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.EncryptionConfig} EncryptionConfig + * @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 */ - EncryptionConfig.decode = function decode(reader, length) { + SqlResultRow.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: { - message.kmsKeyName = reader.string(); + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.cloud.alloydb.v1.SqlResultValue.decode(reader, reader.uint32())); break; } default: @@ -729,124 +671,140 @@ }; /** - * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * Decodes a SqlResultRow message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.EncryptionConfig + * @memberof google.cloud.alloydb.v1.SqlResultRow * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.EncryptionConfig} EncryptionConfig + * @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 */ - EncryptionConfig.decodeDelimited = function decodeDelimited(reader) { + SqlResultRow.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EncryptionConfig message. + * Verifies a SqlResultRow message. * @function verify - * @memberof google.cloud.alloydb.v1.EncryptionConfig + * @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 */ - EncryptionConfig.verify = function verify(message) { + SqlResultRow.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"; + 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 an EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * Creates a SqlResultRow message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.EncryptionConfig + * @memberof google.cloud.alloydb.v1.SqlResultRow * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.EncryptionConfig} EncryptionConfig + * @returns {google.cloud.alloydb.v1.SqlResultRow} SqlResultRow */ - EncryptionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.EncryptionConfig) + SqlResultRow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.SqlResultRow) return object; - var message = new $root.google.cloud.alloydb.v1.EncryptionConfig(); - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); + 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 an EncryptionConfig message. Also converts values to other types if specified. + * Creates a plain object from a SqlResultRow message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.EncryptionConfig + * @memberof google.cloud.alloydb.v1.SqlResultRow * @static - * @param {google.cloud.alloydb.v1.EncryptionConfig} message EncryptionConfig + * @param {google.cloud.alloydb.v1.SqlResultRow} message SqlResultRow * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EncryptionConfig.toObject = function toObject(message, options) { + SqlResultRow.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; + 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 EncryptionConfig to JSON. + * Converts this SqlResultRow to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.EncryptionConfig + * @memberof google.cloud.alloydb.v1.SqlResultRow * @instance * @returns {Object.} JSON object */ - EncryptionConfig.prototype.toJSON = function toJSON() { + SqlResultRow.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EncryptionConfig + * Gets the default type url for SqlResultRow * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.EncryptionConfig + * @memberof google.cloud.alloydb.v1.SqlResultRow * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SqlResultRow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.EncryptionConfig"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.SqlResultRow"; }; - return EncryptionConfig; + return SqlResultRow; })(); - v1.EncryptionInfo = (function() { + v1.SqlResultValue = (function() { /** - * Properties of an EncryptionInfo. + * Properties of a SqlResultValue. * @memberof google.cloud.alloydb.v1 - * @interface IEncryptionInfo - * @property {google.cloud.alloydb.v1.EncryptionInfo.Type|null} [encryptionType] EncryptionInfo encryptionType - * @property {Array.|null} [kmsKeyVersions] EncryptionInfo kmsKeyVersions + * @interface ISqlResultValue + * @property {string|null} [value] SqlResultValue value + * @property {boolean|null} [nullValue] SqlResultValue nullValue */ /** - * Constructs a new EncryptionInfo. + * Constructs a new SqlResultValue. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an EncryptionInfo. - * @implements IEncryptionInfo + * @classdesc Represents a SqlResultValue. + * @implements ISqlResultValue * @constructor - * @param {google.cloud.alloydb.v1.IEncryptionInfo=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.ISqlResultValue=} [properties] Properties to set */ - function EncryptionInfo(properties) { - this.kmsKeyVersions = []; + function SqlResultValue(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -854,92 +812,114 @@ } /** - * EncryptionInfo encryptionType. - * @member {google.cloud.alloydb.v1.EncryptionInfo.Type} encryptionType - * @memberof google.cloud.alloydb.v1.EncryptionInfo + * SqlResultValue value. + * @member {string|null|undefined} value + * @memberof google.cloud.alloydb.v1.SqlResultValue * @instance */ - EncryptionInfo.prototype.encryptionType = 0; + SqlResultValue.prototype.value = null; /** - * EncryptionInfo kmsKeyVersions. - * @member {Array.} kmsKeyVersions - * @memberof google.cloud.alloydb.v1.EncryptionInfo + * SqlResultValue nullValue. + * @member {boolean|null|undefined} nullValue + * @memberof google.cloud.alloydb.v1.SqlResultValue * @instance */ - EncryptionInfo.prototype.kmsKeyVersions = $util.emptyArray; + SqlResultValue.prototype.nullValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Creates a new EncryptionInfo instance using the specified properties. + * SqlResultValue _value. + * @member {"value"|undefined} _value + * @memberof google.cloud.alloydb.v1.SqlResultValue + * @instance + */ + Object.defineProperty(SqlResultValue.prototype, "_value", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SqlResultValue _nullValue. + * @member {"nullValue"|undefined} _nullValue + * @memberof google.cloud.alloydb.v1.SqlResultValue + * @instance + */ + 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.EncryptionInfo + * @memberof google.cloud.alloydb.v1.SqlResultValue * @static - * @param {google.cloud.alloydb.v1.IEncryptionInfo=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.EncryptionInfo} EncryptionInfo instance + * @param {google.cloud.alloydb.v1.ISqlResultValue=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.SqlResultValue} SqlResultValue instance */ - EncryptionInfo.create = function create(properties) { - return new EncryptionInfo(properties); + SqlResultValue.create = function create(properties) { + return new SqlResultValue(properties); }; /** - * Encodes the specified EncryptionInfo message. Does not implicitly {@link google.cloud.alloydb.v1.EncryptionInfo.verify|verify} messages. + * Encodes the specified SqlResultValue message. Does not implicitly {@link google.cloud.alloydb.v1.SqlResultValue.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.EncryptionInfo + * @memberof google.cloud.alloydb.v1.SqlResultValue * @static - * @param {google.cloud.alloydb.v1.IEncryptionInfo} message EncryptionInfo message or plain object to encode + * @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 */ - EncryptionInfo.encode = function encode(message, writer) { + SqlResultValue.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]); + 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 EncryptionInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.EncryptionInfo.verify|verify} messages. + * 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.EncryptionInfo + * @memberof google.cloud.alloydb.v1.SqlResultValue * @static - * @param {google.cloud.alloydb.v1.IEncryptionInfo} message EncryptionInfo message or plain object to encode + * @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 */ - EncryptionInfo.encodeDelimited = function encodeDelimited(message, writer) { + SqlResultValue.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EncryptionInfo message from the specified reader or buffer. + * Decodes a SqlResultValue message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.EncryptionInfo + * @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.EncryptionInfo} EncryptionInfo + * @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 */ - EncryptionInfo.decode = function decode(reader, length) { + SqlResultValue.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: { - message.encryptionType = reader.int32(); + message.value = reader.string(); break; } case 2: { - if (!(message.kmsKeyVersions && message.kmsKeyVersions.length)) - message.kmsKeyVersions = []; - message.kmsKeyVersions.push(reader.string()); + message.nullValue = reader.bool(); break; } default: @@ -951,184 +931,207 @@ }; /** - * Decodes an EncryptionInfo message from the specified reader or buffer, length delimited. + * Decodes a SqlResultValue message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.EncryptionInfo + * @memberof google.cloud.alloydb.v1.SqlResultValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.EncryptionInfo} EncryptionInfo + * @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 */ - EncryptionInfo.decodeDelimited = function decodeDelimited(reader) { + SqlResultValue.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EncryptionInfo message. + * Verifies a SqlResultValue message. * @function verify - * @memberof google.cloud.alloydb.v1.EncryptionInfo + * @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 */ - EncryptionInfo.verify = function verify(message) { + SqlResultValue.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"; + 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 an EncryptionInfo message from a plain object. Also converts values to their respective internal types. + * Creates a SqlResultValue message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.EncryptionInfo + * @memberof google.cloud.alloydb.v1.SqlResultValue * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.EncryptionInfo} EncryptionInfo + * @returns {google.cloud.alloydb.v1.SqlResultValue} SqlResultValue */ - EncryptionInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.EncryptionInfo) + SqlResultValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.SqlResultValue) 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]); - } + 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 an EncryptionInfo message. Also converts values to other types if specified. + * Creates a plain object from a SqlResultValue message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.EncryptionInfo + * @memberof google.cloud.alloydb.v1.SqlResultValue * @static - * @param {google.cloud.alloydb.v1.EncryptionInfo} message EncryptionInfo + * @param {google.cloud.alloydb.v1.SqlResultValue} message SqlResultValue * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EncryptionInfo.toObject = function toObject(message, options) { + SqlResultValue.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]; + 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 EncryptionInfo to JSON. + * Converts this SqlResultValue to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.EncryptionInfo + * @memberof google.cloud.alloydb.v1.SqlResultValue * @instance * @returns {Object.} JSON object */ - EncryptionInfo.prototype.toJSON = function toJSON() { + SqlResultValue.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EncryptionInfo + * Gets the default type url for SqlResultValue * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.EncryptionInfo + * @memberof google.cloud.alloydb.v1.SqlResultValue * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EncryptionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SqlResultValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.EncryptionInfo"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.SqlResultValue"; }; - /** - * 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 SqlResultValue; + })(); - return EncryptionInfo; + /** + * 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; })(); - v1.SslConfig = (function() { + /** + * 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 + */ + 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; + 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 SslConfig. + * Properties of a UserPassword. * @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 + * @interface IUserPassword + * @property {string|null} [user] UserPassword user + * @property {string|null} [password] UserPassword password */ /** - * Constructs a new SslConfig. + * Constructs a new UserPassword. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a SslConfig. - * @implements ISslConfig + * @classdesc Represents a UserPassword. + * @implements IUserPassword * @constructor - * @param {google.cloud.alloydb.v1.ISslConfig=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IUserPassword=} [properties] Properties to set */ - function SslConfig(properties) { + function UserPassword(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1136,89 +1139,89 @@ } /** - * SslConfig sslMode. - * @member {google.cloud.alloydb.v1.SslConfig.SslMode} sslMode - * @memberof google.cloud.alloydb.v1.SslConfig + * UserPassword user. + * @member {string} user + * @memberof google.cloud.alloydb.v1.UserPassword * @instance */ - SslConfig.prototype.sslMode = 0; + UserPassword.prototype.user = ""; /** - * SslConfig caSource. - * @member {google.cloud.alloydb.v1.SslConfig.CaSource} caSource - * @memberof google.cloud.alloydb.v1.SslConfig + * UserPassword password. + * @member {string} password + * @memberof google.cloud.alloydb.v1.UserPassword * @instance */ - SslConfig.prototype.caSource = 0; + UserPassword.prototype.password = ""; /** - * Creates a new SslConfig instance using the specified properties. + * Creates a new UserPassword instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.SslConfig + * @memberof google.cloud.alloydb.v1.UserPassword * @static - * @param {google.cloud.alloydb.v1.ISslConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.SslConfig} SslConfig instance + * @param {google.cloud.alloydb.v1.IUserPassword=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.UserPassword} UserPassword instance */ - SslConfig.create = function create(properties) { - return new SslConfig(properties); + UserPassword.create = function create(properties) { + return new UserPassword(properties); }; /** - * Encodes the specified SslConfig message. Does not implicitly {@link google.cloud.alloydb.v1.SslConfig.verify|verify} messages. + * Encodes the specified UserPassword message. Does not implicitly {@link google.cloud.alloydb.v1.UserPassword.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.SslConfig + * @memberof google.cloud.alloydb.v1.UserPassword * @static - * @param {google.cloud.alloydb.v1.ISslConfig} message SslConfig message or plain object to encode + * @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 */ - SslConfig.encode = function encode(message, writer) { + UserPassword.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); + 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 SslConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SslConfig.verify|verify} messages. + * 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.SslConfig + * @memberof google.cloud.alloydb.v1.UserPassword * @static - * @param {google.cloud.alloydb.v1.ISslConfig} message SslConfig message or plain object to encode + * @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 */ - SslConfig.encodeDelimited = function encodeDelimited(message, writer) { + UserPassword.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SslConfig message from the specified reader or buffer. + * Decodes a UserPassword message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.SslConfig + * @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.SslConfig} SslConfig + * @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 */ - SslConfig.decode = function decode(reader, length) { + UserPassword.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: { - message.sslMode = reader.int32(); + message.user = reader.string(); break; } case 2: { - message.caSource = reader.int32(); + message.password = reader.string(); break; } default: @@ -1230,233 +1233,133 @@ }; /** - * Decodes a SslConfig message from the specified reader or buffer, length delimited. + * Decodes a UserPassword message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.SslConfig + * @memberof google.cloud.alloydb.v1.UserPassword * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.SslConfig} SslConfig + * @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 */ - SslConfig.decodeDelimited = function decodeDelimited(reader) { + UserPassword.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SslConfig message. + * Verifies a UserPassword message. * @function verify - * @memberof google.cloud.alloydb.v1.SslConfig + * @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 */ - SslConfig.verify = function verify(message) { + UserPassword.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; - } + 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 SslConfig message from a plain object. Also converts values to their respective internal types. + * Creates a UserPassword message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.SslConfig + * @memberof google.cloud.alloydb.v1.UserPassword * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.SslConfig} SslConfig + * @returns {google.cloud.alloydb.v1.UserPassword} UserPassword */ - SslConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.SslConfig) + UserPassword.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.UserPassword) 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; - } + 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 SslConfig message. Also converts values to other types if specified. + * Creates a plain object from a UserPassword message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.SslConfig + * @memberof google.cloud.alloydb.v1.UserPassword * @static - * @param {google.cloud.alloydb.v1.SslConfig} message SslConfig + * @param {google.cloud.alloydb.v1.UserPassword} message UserPassword * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SslConfig.toObject = function toObject(message, options) { + UserPassword.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; + object.user = ""; + object.password = ""; } - 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; + 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 SslConfig to JSON. + * Converts this UserPassword to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.SslConfig + * @memberof google.cloud.alloydb.v1.UserPassword * @instance * @returns {Object.} JSON object */ - SslConfig.prototype.toJSON = function toJSON() { + UserPassword.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SslConfig + * Gets the default type url for UserPassword * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.SslConfig + * @memberof google.cloud.alloydb.v1.UserPassword * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SslConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UserPassword.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.SslConfig"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.UserPassword"; }; - /** - * 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; + return UserPassword; })(); - v1.AutomatedBackupPolicy = (function() { + v1.MigrationSource = (function() { /** - * Properties of an AutomatedBackupPolicy. + * Properties of a MigrationSource. * @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 + * @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 AutomatedBackupPolicy. + * Constructs a new MigrationSource. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an AutomatedBackupPolicy. - * @implements IAutomatedBackupPolicy + * @classdesc Represents a MigrationSource. + * @implements IMigrationSource * @constructor - * @param {google.cloud.alloydb.v1.IAutomatedBackupPolicy=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IMigrationSource=} [properties] Properties to set */ - function AutomatedBackupPolicy(properties) { - this.labels = {}; + function MigrationSource(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1464,229 +1367,103 @@ } /** - * 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 + * MigrationSource hostPort. + * @member {string} hostPort + * @memberof google.cloud.alloydb.v1.MigrationSource * @instance */ - Object.defineProperty(AutomatedBackupPolicy.prototype, "schedule", { - get: $util.oneOfGetter($oneOfFields = ["weeklySchedule"]), - set: $util.oneOfSetter($oneOfFields) - }); + MigrationSource.prototype.hostPort = ""; /** - * AutomatedBackupPolicy retention. - * @member {"timeBasedRetention"|"quantityBasedRetention"|undefined} retention - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * MigrationSource referenceId. + * @member {string} referenceId + * @memberof google.cloud.alloydb.v1.MigrationSource * @instance */ - Object.defineProperty(AutomatedBackupPolicy.prototype, "retention", { - get: $util.oneOfGetter($oneOfFields = ["timeBasedRetention", "quantityBasedRetention"]), - set: $util.oneOfSetter($oneOfFields) - }); + MigrationSource.prototype.referenceId = ""; /** - * AutomatedBackupPolicy _enabled. - * @member {"enabled"|undefined} _enabled - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * MigrationSource sourceType. + * @member {google.cloud.alloydb.v1.MigrationSource.MigrationSourceType} sourceType + * @memberof google.cloud.alloydb.v1.MigrationSource * @instance */ - Object.defineProperty(AutomatedBackupPolicy.prototype, "_enabled", { - get: $util.oneOfGetter($oneOfFields = ["enabled"]), - set: $util.oneOfSetter($oneOfFields) - }); + MigrationSource.prototype.sourceType = 0; /** - * Creates a new AutomatedBackupPolicy instance using the specified properties. + * Creates a new MigrationSource instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1.MigrationSource * @static - * @param {google.cloud.alloydb.v1.IAutomatedBackupPolicy=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy} AutomatedBackupPolicy instance + * @param {google.cloud.alloydb.v1.IMigrationSource=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.MigrationSource} MigrationSource instance */ - AutomatedBackupPolicy.create = function create(properties) { - return new AutomatedBackupPolicy(properties); + MigrationSource.create = function create(properties) { + return new MigrationSource(properties); }; /** - * Encodes the specified AutomatedBackupPolicy message. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.verify|verify} messages. + * Encodes the specified MigrationSource message. Does not implicitly {@link google.cloud.alloydb.v1.MigrationSource.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1.MigrationSource * @static - * @param {google.cloud.alloydb.v1.IAutomatedBackupPolicy} message AutomatedBackupPolicy message or plain object to encode + * @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 */ - AutomatedBackupPolicy.encode = function encode(message, writer) { + MigrationSource.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(); + 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 AutomatedBackupPolicy message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.AutomatedBackupPolicy.verify|verify} messages. + * 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.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1.MigrationSource * @static - * @param {google.cloud.alloydb.v1.IAutomatedBackupPolicy} message AutomatedBackupPolicy message or plain object to encode + * @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 */ - AutomatedBackupPolicy.encodeDelimited = function encodeDelimited(message, writer) { + MigrationSource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AutomatedBackupPolicy message from the specified reader or buffer. + * Decodes a MigrationSource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @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.AutomatedBackupPolicy} AutomatedBackupPolicy + * @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 */ - AutomatedBackupPolicy.decode = function decode(reader, length) { + MigrationSource.decode = function decode(reader, length) { 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; + 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(); 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()); + message.hostPort = reader.string(); break; } - case 6: { - message.location = reader.string(); + case 2: { + message.referenceId = 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; + case 3: { + message.sourceType = reader.int32(); break; } default: @@ -1698,356 +1475,1578 @@ }; /** - * Decodes an AutomatedBackupPolicy message from the specified reader or buffer, length delimited. + * Decodes a MigrationSource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1.MigrationSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy} AutomatedBackupPolicy + * @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 */ - AutomatedBackupPolicy.decodeDelimited = function decodeDelimited(reader) { + MigrationSource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AutomatedBackupPolicy message. + * Verifies a MigrationSource message. * @function verify - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @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 */ - AutomatedBackupPolicy.verify = function verify(message) { + MigrationSource.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.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; } - } - 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. + * Creates a MigrationSource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1.MigrationSource * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy} AutomatedBackupPolicy + * @returns {google.cloud.alloydb.v1.MigrationSource} MigrationSource */ - AutomatedBackupPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.AutomatedBackupPolicy) + MigrationSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.MigrationSource) 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]]); + 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 an AutomatedBackupPolicy message. Also converts values to other types if specified. + * Creates a plain object from a MigrationSource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1.MigrationSource * @static - * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy} message AutomatedBackupPolicy + * @param {google.cloud.alloydb.v1.MigrationSource} message MigrationSource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AutomatedBackupPolicy.toObject = function toObject(message, options) { + MigrationSource.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]]; + object.hostPort = ""; + object.referenceId = ""; + object.sourceType = options.enums === String ? "MIGRATION_SOURCE_TYPE_UNSPECIFIED" : 0; } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.toObject(message.encryptionConfig, options); + 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 AutomatedBackupPolicy to JSON. + * Converts this MigrationSource to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1.MigrationSource * @instance * @returns {Object.} JSON object */ - AutomatedBackupPolicy.prototype.toJSON = function toJSON() { + MigrationSource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AutomatedBackupPolicy + * Gets the default type url for MigrationSource * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @memberof google.cloud.alloydb.v1.MigrationSource * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AutomatedBackupPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MigrationSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.AutomatedBackupPolicy"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.MigrationSource"; }; - AutomatedBackupPolicy.WeeklySchedule = (function() { + /** + * 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; + })(); - /** - * Properties of a WeeklySchedule. - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @interface IWeeklySchedule - * @property {Array.|null} [startTimes] WeeklySchedule startTimes - * @property {Array.|null} [daysOfWeek] WeeklySchedule daysOfWeek - */ + return MigrationSource; + })(); - /** - * 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]]; - } + v1.EncryptionConfig = (function() { - /** - * WeeklySchedule startTimes. - * @member {Array.} startTimes - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule - * @instance - */ - WeeklySchedule.prototype.startTimes = $util.emptyArray; + /** + * Properties of an EncryptionConfig. + * @memberof google.cloud.alloydb.v1 + * @interface IEncryptionConfig + * @property {string|null} [kmsKeyName] EncryptionConfig kmsKeyName + */ - /** - * WeeklySchedule daysOfWeek. - * @member {Array.} daysOfWeek - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule - * @instance - */ - WeeklySchedule.prototype.daysOfWeek = $util.emptyArray; + /** + * 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]]; + } - /** - * 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); - }; + /** + * EncryptionConfig kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.alloydb.v1.EncryptionConfig + * @instance + */ + EncryptionConfig.prototype.kmsKeyName = ""; - /** - * 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; - }; + /** + * 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 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(); - }; + /** + * 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; + }; - /** - * 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) { - 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(); - 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); + /** + * 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.kmsKeyName = reader.string(); break; } + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + 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) { + 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(); + 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) { + 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(); + 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) + }); + + /** + * AutomatedBackupPolicy _enabled. + * @member {"enabled"|undefined} _enabled + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy + * @instance + */ + 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) { + 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(); + 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) { + 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(); + 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 @@ -2105,568 +3104,1430 @@ }; /** - * Creates a WeeklySchedule message from a plain object. Also converts values to their respective internal types. + * 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) { + 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(); + 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) { + 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(); + 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.WeeklySchedule + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule} WeeklySchedule + * @returns {google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention} QuantityBasedRetention */ - WeeklySchedule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule) + 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.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; - } - } + 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 WeeklySchedule message. Also converts values to other types if specified. + * Creates a plain object from a QuantityBasedRetention message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention * @static - * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule} message WeeklySchedule + * @param {google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention} message QuantityBasedRetention * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WeeklySchedule.toObject = function toObject(message, options) { + QuantityBasedRetention.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]; - } + if (options.defaults) + object.count = 0; + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; return object; }; /** - * Converts this WeeklySchedule to JSON. + * Converts this QuantityBasedRetention to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention * @instance * @returns {Object.} JSON object */ - WeeklySchedule.prototype.toJSON = function toJSON() { + QuantityBasedRetention.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for WeeklySchedule + * Gets the default type url for QuantityBasedRetention * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule + * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - WeeklySchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + QuantityBasedRetention.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.AutomatedBackupPolicy.WeeklySchedule"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention"; }; - return WeeklySchedule; + return QuantityBasedRetention; })(); - AutomatedBackupPolicy.TimeBasedRetention = (function() { + return AutomatedBackupPolicy; + })(); - /** - * Properties of a TimeBasedRetention. - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @interface ITimeBasedRetention - * @property {google.protobuf.IDuration|null} [retentionPeriod] TimeBasedRetention retentionPeriod - */ + v1.ContinuousBackupConfig = (function() { - /** - * 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]]; + /** + * 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; + + /** + * ContinuousBackupConfig _enabled. + * @member {"enabled"|undefined} _enabled + * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig + * @instance + */ + 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) { + 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(); + 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; + }; - /** - * TimeBasedRetention retentionPeriod. - * @member {google.protobuf.IDuration|null|undefined} retentionPeriod - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.TimeBasedRetention - * @instance - */ - TimeBasedRetention.prototype.retentionPeriod = null; + /** + * 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(); + }; - /** - * 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); - }; + /** + * 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) { + 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(); + 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; + }; - /** - * 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; - }; + /** + * 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()); + }; - /** - * 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(); - }; + /** + * 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; + }; - /** - * 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.retentionPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + /** + * 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; } - default: - reader.skipType(tag & 7); + 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; } - } - 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; - }; + } + 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 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 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; + }; - /** - * 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 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); + }; - /** - * 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 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"; + }; - /** - * 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 ContinuousBackupInfo; + })(); - return TimeBasedRetention; - })(); + v1.BackupSource = (function() { - AutomatedBackupPolicy.QuantityBasedRetention = (function() { + /** + * Properties of a BackupSource. + * @memberof google.cloud.alloydb.v1 + * @interface IBackupSource + * @property {string|null} [backupUid] BackupSource backupUid + * @property {string|null} [backupName] BackupSource backupName + */ - /** - * Properties of a QuantityBasedRetention. - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy - * @interface IQuantityBasedRetention - * @property {number|null} [count] QuantityBasedRetention count - */ + /** + * 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]]; + } - /** - * 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]]; - } + /** + * BackupSource backupUid. + * @member {string} backupUid + * @memberof google.cloud.alloydb.v1.BackupSource + * @instance + */ + BackupSource.prototype.backupUid = ""; - /** - * QuantityBasedRetention count. - * @member {number} count - * @memberof google.cloud.alloydb.v1.AutomatedBackupPolicy.QuantityBasedRetention - * @instance - */ - QuantityBasedRetention.prototype.count = 0; + /** + * BackupSource backupName. + * @member {string} backupName + * @memberof google.cloud.alloydb.v1.BackupSource + * @instance + */ + BackupSource.prototype.backupName = ""; - /** - * 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); - }; + /** + * 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 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 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 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(); - }; + /** + * 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 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) { - 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(); - switch (tag >>> 3) { - case 1: { - message.count = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); + /** + * 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) { + 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(); + 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 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()); - }; + } + return message; + }; - /** - * 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; - }; + /** + * 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()); + }; - /** - * 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; - }; + /** + * 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 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; + /** + * 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; + }; - /** - * 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); - }; + /** + * 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; + }; - /** - * 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"; - }; + /** + * 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); + }; - return QuantityBasedRetention; - })(); + /** + * 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 AutomatedBackupPolicy; + return BackupSource; })(); - v1.ContinuousBackupConfig = (function() { + v1.ContinuousBackupSource = (function() { /** - * Properties of a ContinuousBackupConfig. + * Properties of a ContinuousBackupSource. * @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 + * @interface IContinuousBackupSource + * @property {string|null} [cluster] ContinuousBackupSource cluster + * @property {google.protobuf.ITimestamp|null} [pointInTime] ContinuousBackupSource pointInTime */ /** - * Constructs a new ContinuousBackupConfig. + * Constructs a new ContinuousBackupSource. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ContinuousBackupConfig. - * @implements IContinuousBackupConfig + * @classdesc Represents a ContinuousBackupSource. + * @implements IContinuousBackupSource * @constructor - * @param {google.cloud.alloydb.v1.IContinuousBackupConfig=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IContinuousBackupSource=} [properties] Properties to set */ - function ContinuousBackupConfig(properties) { + function ContinuousBackupSource(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2674,117 +4535,89 @@ } /** - * 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 + * ContinuousBackupSource cluster. + * @member {string} cluster + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource * @instance */ - ContinuousBackupConfig.prototype.encryptionConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ContinuousBackupSource.prototype.cluster = ""; /** - * ContinuousBackupConfig _enabled. - * @member {"enabled"|undefined} _enabled - * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig + * ContinuousBackupSource pointInTime. + * @member {google.protobuf.ITimestamp|null|undefined} pointInTime + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource * @instance */ - Object.defineProperty(ContinuousBackupConfig.prototype, "_enabled", { - get: $util.oneOfGetter($oneOfFields = ["enabled"]), - set: $util.oneOfSetter($oneOfFields) - }); + ContinuousBackupSource.prototype.pointInTime = null; /** - * Creates a new ContinuousBackupConfig instance using the specified properties. + * Creates a new ContinuousBackupSource instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource * @static - * @param {google.cloud.alloydb.v1.IContinuousBackupConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ContinuousBackupConfig} ContinuousBackupConfig instance + * @param {google.cloud.alloydb.v1.IContinuousBackupSource=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ContinuousBackupSource} ContinuousBackupSource instance */ - ContinuousBackupConfig.create = function create(properties) { - return new ContinuousBackupConfig(properties); + ContinuousBackupSource.create = function create(properties) { + return new ContinuousBackupSource(properties); }; /** - * Encodes the specified ContinuousBackupConfig message. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupConfig.verify|verify} messages. + * Encodes the specified ContinuousBackupSource message. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupSource.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource * @static - * @param {google.cloud.alloydb.v1.IContinuousBackupConfig} message ContinuousBackupConfig message or plain object to encode + * @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 */ - ContinuousBackupConfig.encode = function encode(message, writer) { + ContinuousBackupSource.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); + 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 ContinuousBackupConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupConfig.verify|verify} messages. + * 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.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource * @static - * @param {google.cloud.alloydb.v1.IContinuousBackupConfig} message ContinuousBackupConfig message or plain object to encode + * @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 */ - ContinuousBackupConfig.encodeDelimited = function encodeDelimited(message, writer) { + ContinuousBackupSource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ContinuousBackupConfig message from the specified reader or buffer. + * Decodes a ContinuousBackupSource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig + * @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.ContinuousBackupConfig} ContinuousBackupConfig + * @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 */ - ContinuousBackupConfig.decode = function decode(reader, length) { + ContinuousBackupSource.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: { - message.enabled = reader.bool(); - break; - } - case 4: { - message.recoveryWindowDays = reader.int32(); + message.cluster = reader.string(); break; } - case 3: { - message.encryptionConfig = $root.google.cloud.alloydb.v1.EncryptionConfig.decode(reader, reader.uint32()); + case 2: { + message.pointInTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } default: @@ -2796,153 +4629,137 @@ }; /** - * Decodes a ContinuousBackupConfig message from the specified reader or buffer, length delimited. + * Decodes a ContinuousBackupSource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ContinuousBackupConfig} ContinuousBackupConfig + * @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 */ - ContinuousBackupConfig.decodeDelimited = function decodeDelimited(reader) { + ContinuousBackupSource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ContinuousBackupConfig message. + * Verifies a ContinuousBackupSource message. * @function verify - * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig + * @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 */ - ContinuousBackupConfig.verify = function verify(message) { + ContinuousBackupSource.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 (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 "encryptionConfig." + error; + return "pointInTime." + error; } return null; }; /** - * Creates a ContinuousBackupConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ContinuousBackupSource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ContinuousBackupConfig} ContinuousBackupConfig + * @returns {google.cloud.alloydb.v1.ContinuousBackupSource} ContinuousBackupSource */ - ContinuousBackupConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ContinuousBackupConfig) + ContinuousBackupSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ContinuousBackupSource) 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); + 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 ContinuousBackupConfig message. Also converts values to other types if specified. + * Creates a plain object from a ContinuousBackupSource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource * @static - * @param {google.cloud.alloydb.v1.ContinuousBackupConfig} message ContinuousBackupConfig + * @param {google.cloud.alloydb.v1.ContinuousBackupSource} message ContinuousBackupSource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ContinuousBackupConfig.toObject = function toObject(message, options) { + ContinuousBackupSource.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; + 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 ContinuousBackupConfig to JSON. + * Converts this ContinuousBackupSource to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource * @instance * @returns {Object.} JSON object */ - ContinuousBackupConfig.prototype.toJSON = function toJSON() { + ContinuousBackupSource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ContinuousBackupConfig + * Gets the default type url for ContinuousBackupSource * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ContinuousBackupConfig + * @memberof google.cloud.alloydb.v1.ContinuousBackupSource * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ContinuousBackupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ContinuousBackupSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ContinuousBackupConfig"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.ContinuousBackupSource"; }; - return ContinuousBackupConfig; + return ContinuousBackupSource; })(); - v1.ContinuousBackupInfo = (function() { + v1.MaintenanceUpdatePolicy = (function() { /** - * Properties of a ContinuousBackupInfo. + * Properties of a MaintenanceUpdatePolicy. * @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 + * @interface IMaintenanceUpdatePolicy + * @property {Array.|null} [maintenanceWindows] MaintenanceUpdatePolicy maintenanceWindows */ /** - * Constructs a new ContinuousBackupInfo. + * Constructs a new MaintenanceUpdatePolicy. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ContinuousBackupInfo. - * @implements IContinuousBackupInfo + * @classdesc Represents a MaintenanceUpdatePolicy. + * @implements IMaintenanceUpdatePolicy * @constructor - * @param {google.cloud.alloydb.v1.IContinuousBackupInfo=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IMaintenanceUpdatePolicy=} [properties] Properties to set */ - function ContinuousBackupInfo(properties) { - this.schedule = []; + function MaintenanceUpdatePolicy(properties) { + this.maintenanceWindows = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2950,128 +4767,78 @@ } /** - * 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 + * MaintenanceUpdatePolicy maintenanceWindows. + * @member {Array.} maintenanceWindows + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy * @instance */ - ContinuousBackupInfo.prototype.earliestRestorableTime = null; + MaintenanceUpdatePolicy.prototype.maintenanceWindows = $util.emptyArray; /** - * Creates a new ContinuousBackupInfo instance using the specified properties. + * Creates a new MaintenanceUpdatePolicy instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy * @static - * @param {google.cloud.alloydb.v1.IContinuousBackupInfo=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ContinuousBackupInfo} ContinuousBackupInfo instance + * @param {google.cloud.alloydb.v1.IMaintenanceUpdatePolicy=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy instance */ - ContinuousBackupInfo.create = function create(properties) { - return new ContinuousBackupInfo(properties); + MaintenanceUpdatePolicy.create = function create(properties) { + return new MaintenanceUpdatePolicy(properties); }; /** - * Encodes the specified ContinuousBackupInfo message. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupInfo.verify|verify} messages. + * Encodes the specified MaintenanceUpdatePolicy message. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceUpdatePolicy.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy * @static - * @param {google.cloud.alloydb.v1.IContinuousBackupInfo} message ContinuousBackupInfo message or plain object to encode + * @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 */ - ContinuousBackupInfo.encode = function encode(message, writer) { + MaintenanceUpdatePolicy.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(); + 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(); return writer; }; /** - * Encodes the specified ContinuousBackupInfo message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupInfo.verify|verify} messages. + * 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.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy * @static - * @param {google.cloud.alloydb.v1.IContinuousBackupInfo} message ContinuousBackupInfo message or plain object to encode + * @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 */ - ContinuousBackupInfo.encodeDelimited = function encodeDelimited(message, writer) { + MaintenanceUpdatePolicy.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ContinuousBackupInfo message from the specified reader or buffer. + * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @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.ContinuousBackupInfo} ContinuousBackupInfo + * @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 */ - ContinuousBackupInfo.decode = function decode(reader, length) { + MaintenanceUpdatePolicy.decode = function decode(reader, length) { 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(); + 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(); 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()); + if (!(message.maintenanceWindows && message.maintenanceWindows.length)) + message.maintenanceWindows = []; + message.maintenanceWindows.push($root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow.decode(reader, reader.uint32())); break; } default: @@ -3083,452 +4850,420 @@ }; /** - * Decodes a ContinuousBackupInfo message from the specified reader or buffer, length delimited. + * Decodes a MaintenanceUpdatePolicy message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ContinuousBackupInfo} ContinuousBackupInfo + * @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 */ - ContinuousBackupInfo.decodeDelimited = function decodeDelimited(reader) { + MaintenanceUpdatePolicy.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ContinuousBackupInfo message. + * Verifies a MaintenanceUpdatePolicy message. * @function verify - * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @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 */ - ContinuousBackupInfo.verify = function verify(message) { + MaintenanceUpdatePolicy.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; + 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; + } } return null; }; /** - * Creates a ContinuousBackupInfo message from a plain object. Also converts values to their respective internal types. + * Creates a MaintenanceUpdatePolicy message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ContinuousBackupInfo} ContinuousBackupInfo + * @returns {google.cloud.alloydb.v1.MaintenanceUpdatePolicy} MaintenanceUpdatePolicy */ - ContinuousBackupInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ContinuousBackupInfo) + MaintenanceUpdatePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.MaintenanceUpdatePolicy) 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); + 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]); + } } return message; }; /** - * Creates a plain object from a ContinuousBackupInfo message. Also converts values to other types if specified. + * Creates a plain object from a MaintenanceUpdatePolicy message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy * @static - * @param {google.cloud.alloydb.v1.ContinuousBackupInfo} message ContinuousBackupInfo + * @param {google.cloud.alloydb.v1.MaintenanceUpdatePolicy} message MaintenanceUpdatePolicy * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ContinuousBackupInfo.toObject = function toObject(message, options) { + MaintenanceUpdatePolicy.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]; + object.maintenanceWindows = []; + 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.earliestRestorableTime != null && message.hasOwnProperty("earliestRestorableTime")) - object.earliestRestorableTime = $root.google.protobuf.Timestamp.toObject(message.earliestRestorableTime, options); return object; }; /** - * Converts this ContinuousBackupInfo to JSON. + * Converts this MaintenanceUpdatePolicy to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy * @instance * @returns {Object.} JSON object */ - ContinuousBackupInfo.prototype.toJSON = function toJSON() { + MaintenanceUpdatePolicy.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ContinuousBackupInfo + * Gets the default type url for MaintenanceUpdatePolicy * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ContinuousBackupInfo + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ContinuousBackupInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MaintenanceUpdatePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ContinuousBackupInfo"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.MaintenanceUpdatePolicy"; }; - return ContinuousBackupInfo; - })(); + MaintenanceUpdatePolicy.MaintenanceWindow = (function() { - v1.BackupSource = (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 + */ - /** - * 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 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]]; + } - /** - * 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]]; - } + /** + * MaintenanceWindow day. + * @member {google.type.DayOfWeek} day + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow + * @instance + */ + MaintenanceWindow.prototype.day = 0; - /** - * BackupSource backupUid. - * @member {string} backupUid - * @memberof google.cloud.alloydb.v1.BackupSource - * @instance - */ - BackupSource.prototype.backupUid = ""; + /** + * MaintenanceWindow startTime. + * @member {google.type.ITimeOfDay|null|undefined} startTime + * @memberof google.cloud.alloydb.v1.MaintenanceUpdatePolicy.MaintenanceWindow + * @instance + */ + MaintenanceWindow.prototype.startTime = null; - /** - * BackupSource backupName. - * @member {string} backupName - * @memberof google.cloud.alloydb.v1.BackupSource - * @instance - */ - BackupSource.prototype.backupName = ""; + /** + * 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); + }; - /** - * 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 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 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 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(); + }; - /** - * 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 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) { + 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(); + 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 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) { - 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(); - switch (tag >>> 3) { - case 2: { - message.backupUid = reader.string(); + /** + * 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; } - case 1: { - message.backupName = reader.string(); + 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; } - default: - reader.skipType(tag & 7); + 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; } - } - 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; - }; + 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 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) + /** + * 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; - 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 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); + }; - /** - * 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 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"; + }; - /** - * 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 MaintenanceWindow; + })(); - return BackupSource; + return MaintenanceUpdatePolicy; })(); - v1.ContinuousBackupSource = (function() { + v1.MaintenanceSchedule = (function() { /** - * Properties of a ContinuousBackupSource. + * Properties of a MaintenanceSchedule. * @memberof google.cloud.alloydb.v1 - * @interface IContinuousBackupSource - * @property {string|null} [cluster] ContinuousBackupSource cluster - * @property {google.protobuf.ITimestamp|null} [pointInTime] ContinuousBackupSource pointInTime + * @interface IMaintenanceSchedule + * @property {google.protobuf.ITimestamp|null} [startTime] MaintenanceSchedule startTime */ /** - * Constructs a new ContinuousBackupSource. + * Constructs a new MaintenanceSchedule. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ContinuousBackupSource. - * @implements IContinuousBackupSource + * @classdesc Represents a MaintenanceSchedule. + * @implements IMaintenanceSchedule * @constructor - * @param {google.cloud.alloydb.v1.IContinuousBackupSource=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IMaintenanceSchedule=} [properties] Properties to set */ - function ContinuousBackupSource(properties) { + function MaintenanceSchedule(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3536,89 +5271,75 @@ } /** - * 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 + * MaintenanceSchedule startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.alloydb.v1.MaintenanceSchedule * @instance */ - ContinuousBackupSource.prototype.pointInTime = null; + MaintenanceSchedule.prototype.startTime = null; /** - * Creates a new ContinuousBackupSource instance using the specified properties. + * Creates a new MaintenanceSchedule instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1.MaintenanceSchedule * @static - * @param {google.cloud.alloydb.v1.IContinuousBackupSource=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ContinuousBackupSource} ContinuousBackupSource instance + * @param {google.cloud.alloydb.v1.IMaintenanceSchedule=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.MaintenanceSchedule} MaintenanceSchedule instance */ - ContinuousBackupSource.create = function create(properties) { - return new ContinuousBackupSource(properties); + MaintenanceSchedule.create = function create(properties) { + return new MaintenanceSchedule(properties); }; /** - * Encodes the specified ContinuousBackupSource message. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupSource.verify|verify} messages. + * Encodes the specified MaintenanceSchedule message. Does not implicitly {@link google.cloud.alloydb.v1.MaintenanceSchedule.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1.MaintenanceSchedule * @static - * @param {google.cloud.alloydb.v1.IContinuousBackupSource} message ContinuousBackupSource message or plain object to encode + * @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 */ - ContinuousBackupSource.encode = function encode(message, writer) { + MaintenanceSchedule.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(); + 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 ContinuousBackupSource message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ContinuousBackupSource.verify|verify} messages. + * 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.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1.MaintenanceSchedule * @static - * @param {google.cloud.alloydb.v1.IContinuousBackupSource} message ContinuousBackupSource message or plain object to encode + * @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 */ - ContinuousBackupSource.encodeDelimited = function encodeDelimited(message, writer) { + MaintenanceSchedule.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ContinuousBackupSource message from the specified reader or buffer. + * Decodes a MaintenanceSchedule message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @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.ContinuousBackupSource} ContinuousBackupSource + * @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 */ - ContinuousBackupSource.decode = function decode(reader, length) { + MaintenanceSchedule.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: { - message.cluster = reader.string(); - break; - } - case 2: { - message.pointInTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } default: @@ -3630,116 +5351,107 @@ }; /** - * Decodes a ContinuousBackupSource message from the specified reader or buffer, length delimited. + * Decodes a MaintenanceSchedule message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1.MaintenanceSchedule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ContinuousBackupSource} ContinuousBackupSource + * @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 */ - ContinuousBackupSource.decodeDelimited = function decodeDelimited(reader) { + MaintenanceSchedule.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ContinuousBackupSource message. + * Verifies a MaintenanceSchedule message. * @function verify - * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @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 */ - ContinuousBackupSource.verify = function verify(message) { + MaintenanceSchedule.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 (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); if (error) - return "pointInTime." + error; + return "startTime." + error; } return null; }; /** - * Creates a ContinuousBackupSource message from a plain object. Also converts values to their respective internal types. + * Creates a MaintenanceSchedule message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1.MaintenanceSchedule * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ContinuousBackupSource} ContinuousBackupSource + * @returns {google.cloud.alloydb.v1.MaintenanceSchedule} MaintenanceSchedule */ - ContinuousBackupSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ContinuousBackupSource) + MaintenanceSchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.MaintenanceSchedule) 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); + 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 ContinuousBackupSource message. Also converts values to other types if specified. + * Creates a plain object from a MaintenanceSchedule message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1.MaintenanceSchedule * @static - * @param {google.cloud.alloydb.v1.ContinuousBackupSource} message ContinuousBackupSource + * @param {google.cloud.alloydb.v1.MaintenanceSchedule} message MaintenanceSchedule * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ContinuousBackupSource.toObject = function toObject(message, options) { + MaintenanceSchedule.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); + 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 ContinuousBackupSource to JSON. + * Converts this MaintenanceSchedule to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1.MaintenanceSchedule * @instance * @returns {Object.} JSON object */ - ContinuousBackupSource.prototype.toJSON = function toJSON() { + MaintenanceSchedule.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ContinuousBackupSource + * Gets the default type url for MaintenanceSchedule * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ContinuousBackupSource + * @memberof google.cloud.alloydb.v1.MaintenanceSchedule * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ContinuousBackupSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MaintenanceSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ContinuousBackupSource"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.MaintenanceSchedule"; }; - return ContinuousBackupSource; + return MaintenanceSchedule; })(); v1.Cluster = (function() { @@ -3774,6 +5486,13 @@ * @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 */ /** @@ -3787,6 +5506,7 @@ 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) @@ -4001,6 +5721,62 @@ */ 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; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -4093,6 +5869,21 @@ $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(); return writer; }; @@ -4269,6 +6060,53 @@ 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; + } default: reader.skipType(tag & 7); break; @@ -4387,6 +6225,8 @@ case 0: case 1: case 2: + case 3: + case 4: break; } if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) { @@ -4456,6 +6296,46 @@ 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"; + } return null; }; @@ -4596,6 +6476,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; } if (object.networkConfig != null) { if (typeof object.networkConfig !== "object") @@ -4660,6 +6548,55 @@ 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]]); + } return message; }; @@ -4679,6 +6616,7 @@ if (options.objects || options.defaults) { object.labels = {}; object.annotations = {}; + object.tags = {}; } if (options.defaults) { object.name = ""; @@ -4703,6 +6641,12 @@ 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; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -4769,6 +6713,23 @@ 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]]; + } return object; }; @@ -5447,6 +7408,502 @@ return PrimaryConfig; })(); + Cluster.PscConfig = (function() { + + /** + * Properties of a PscConfig. + * @memberof google.cloud.alloydb.v1.Cluster + * @interface IPscConfig + * @property {boolean|null} [pscEnabled] PscConfig pscEnabled + */ + + /** + * 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; + + /** + * 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); + 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) { + 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(); + switch (tag >>> 3) { + case 1: { + message.pscEnabled = reader.bool(); + 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"; + 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); + 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 (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) + object.pscEnabled = message.pscEnabled; + 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) { + 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(); + 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; + })(); + /** * State enum. * @name google.cloud.alloydb.v1.Cluster.State @@ -5520,10 +7977,15 @@ * @property {google.cloud.alloydb.v1.Instance.IQueryInsightsInstanceConfig|null} [queryInsightsConfig] Instance queryInsightsConfig * @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 */ /** @@ -5539,6 +8001,7 @@ 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) @@ -5689,6 +8152,14 @@ */ Instance.prototype.ipAddress = ""; + /** + * Instance publicIpAddress. + * @member {string} publicIpAddress + * @memberof google.cloud.alloydb.v1.Instance + * @instance + */ + Instance.prototype.publicIpAddress = ""; + /** * Instance reconciling. * @member {boolean} reconciling @@ -5721,6 +8192,38 @@ */ 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; + /** * Creates a new Instance instance using the specified properties. * @function create @@ -5793,6 +8296,17 @@ $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.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]); return writer; }; @@ -5939,6 +8453,10 @@ message.ipAddress = reader.string(); break; } + case 27: { + message.publicIpAddress = reader.string(); + break; + } case 16: { message.reconciling = reader.bool(); break; @@ -5974,6 +8492,24 @@ 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; + } default: reader.skipType(tag & 7); break; @@ -6118,6 +8654,9 @@ 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"; @@ -6137,6 +8676,26 @@ 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"; + } return null; }; @@ -6309,6 +8868,8 @@ } 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) @@ -6325,6 +8886,25 @@ 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]); + } return message; }; @@ -6341,8 +8921,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.nodes = []; + object.outboundPublicIpAddresses = []; + } if (options.objects || options.defaults) { object.labels = {}; object.databaseFlags = {}; @@ -6367,6 +8949,10 @@ object.writableNode = null; object.queryInsightsConfig = null; object.clientConnectionConfig = null; + object.satisfiesPzs = false; + object.publicIpAddress = ""; + object.pscInstanceConfig = null; + object.networkConfig = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -6425,6 +9011,19 @@ 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.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]; + } return object; }; @@ -7245,30 +9844,468 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.QueryInsightsInstanceConfig"; + }; + + return QueryInsightsInstanceConfig; + })(); + + 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) { + 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(); + 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) { + 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(); + 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 QueryInsightsInstanceConfig; + return ClientConnectionConfig; })(); - Instance.ReadPoolConfig = (function() { + Instance.PscInstanceConfig = (function() { /** - * Properties of a ReadPoolConfig. + * Properties of a PscInstanceConfig. * @memberof google.cloud.alloydb.v1.Instance - * @interface IReadPoolConfig - * @property {number|null} [nodeCount] ReadPoolConfig nodeCount + * @interface IPscInstanceConfig + * @property {string|null} [serviceAttachmentLink] PscInstanceConfig serviceAttachmentLink + * @property {Array.|null} [allowedConsumerProjects] PscInstanceConfig allowedConsumerProjects + * @property {string|null} [pscDnsName] PscInstanceConfig pscDnsName */ /** - * Constructs a new ReadPoolConfig. + * Constructs a new PscInstanceConfig. * @memberof google.cloud.alloydb.v1.Instance - * @classdesc Represents a ReadPoolConfig. - * @implements IReadPoolConfig + * @classdesc Represents a PscInstanceConfig. + * @implements IPscInstanceConfig * @constructor - * @param {google.cloud.alloydb.v1.Instance.IReadPoolConfig=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.Instance.IPscInstanceConfig=} [properties] Properties to set */ - function ReadPoolConfig(properties) { + function PscInstanceConfig(properties) { + this.allowedConsumerProjects = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7276,75 +10313,106 @@ } /** - * ReadPoolConfig nodeCount. - * @member {number} nodeCount - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * PscInstanceConfig serviceAttachmentLink. + * @member {string} serviceAttachmentLink + * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig * @instance */ - ReadPoolConfig.prototype.nodeCount = 0; + PscInstanceConfig.prototype.serviceAttachmentLink = ""; /** - * Creates a new ReadPoolConfig instance using the specified properties. + * 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 = ""; + + /** + * Creates a new PscInstanceConfig instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig * @static - * @param {google.cloud.alloydb.v1.Instance.IReadPoolConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Instance.ReadPoolConfig} ReadPoolConfig instance + * @param {google.cloud.alloydb.v1.Instance.IPscInstanceConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Instance.PscInstanceConfig} PscInstanceConfig instance */ - ReadPoolConfig.create = function create(properties) { - return new ReadPoolConfig(properties); + PscInstanceConfig.create = function create(properties) { + return new PscInstanceConfig(properties); }; /** - * Encodes the specified ReadPoolConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ReadPoolConfig.verify|verify} messages. + * 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.ReadPoolConfig + * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig * @static - * @param {google.cloud.alloydb.v1.Instance.IReadPoolConfig} message ReadPoolConfig message or plain object to encode + * @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 */ - ReadPoolConfig.encode = function encode(message, writer) { + PscInstanceConfig.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); + 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); return writer; }; /** - * Encodes the specified ReadPoolConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ReadPoolConfig.verify|verify} messages. + * 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.ReadPoolConfig + * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig * @static - * @param {google.cloud.alloydb.v1.Instance.IReadPoolConfig} message ReadPoolConfig message or plain object to encode + * @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 */ - ReadPoolConfig.encodeDelimited = function encodeDelimited(message, writer) { + PscInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReadPoolConfig message from the specified reader or buffer. + * Decodes a PscInstanceConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @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.ReadPoolConfig} ReadPoolConfig + * @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 */ - ReadPoolConfig.decode = function decode(reader, length) { + PscInstanceConfig.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: { - message.nodeCount = reader.int32(); + 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; } default: @@ -7356,123 +10424,155 @@ }; /** - * Decodes a ReadPoolConfig message from the specified reader or buffer, length delimited. + * Decodes a PscInstanceConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @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.ReadPoolConfig} ReadPoolConfig + * @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 */ - ReadPoolConfig.decodeDelimited = function decodeDelimited(reader) { + PscInstanceConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReadPoolConfig message. + * Verifies a PscInstanceConfig message. * @function verify - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @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 */ - ReadPoolConfig.verify = function verify(message) { + PscInstanceConfig.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"; + 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"; return null; }; /** - * Creates a ReadPoolConfig message from a plain object. Also converts values to their respective internal types. + * Creates a PscInstanceConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Instance.ReadPoolConfig} ReadPoolConfig + * @returns {google.cloud.alloydb.v1.Instance.PscInstanceConfig} PscInstanceConfig */ - ReadPoolConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Instance.ReadPoolConfig) + 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.ReadPoolConfig(); - if (object.nodeCount != null) - message.nodeCount = object.nodeCount | 0; + 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); return message; }; /** - * Creates a plain object from a ReadPoolConfig message. Also converts values to other types if specified. + * Creates a plain object from a PscInstanceConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig * @static - * @param {google.cloud.alloydb.v1.Instance.ReadPoolConfig} message ReadPoolConfig + * @param {google.cloud.alloydb.v1.Instance.PscInstanceConfig} message PscInstanceConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReadPoolConfig.toObject = function toObject(message, options) { + PscInstanceConfig.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; + if (options.arrays || options.defaults) + object.allowedConsumerProjects = []; + 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; return object; }; /** - * Converts this ReadPoolConfig to JSON. + * Converts this PscInstanceConfig to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig * @instance * @returns {Object.} JSON object */ - ReadPoolConfig.prototype.toJSON = function toJSON() { + PscInstanceConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ReadPoolConfig + * Gets the default type url for PscInstanceConfig * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Instance.ReadPoolConfig + * @memberof google.cloud.alloydb.v1.Instance.PscInstanceConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ReadPoolConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PscInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.ReadPoolConfig"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.Instance.PscInstanceConfig"; }; - return ReadPoolConfig; + return PscInstanceConfig; })(); - Instance.ClientConnectionConfig = (function() { + Instance.InstanceNetworkConfig = (function() { /** - * Properties of a ClientConnectionConfig. + * Properties of an InstanceNetworkConfig. * @memberof google.cloud.alloydb.v1.Instance - * @interface IClientConnectionConfig - * @property {boolean|null} [requireConnectors] ClientConnectionConfig requireConnectors - * @property {google.cloud.alloydb.v1.ISslConfig|null} [sslConfig] ClientConnectionConfig sslConfig + * @interface IInstanceNetworkConfig + * @property {Array.|null} [authorizedExternalNetworks] InstanceNetworkConfig authorizedExternalNetworks + * @property {boolean|null} [enablePublicIp] InstanceNetworkConfig enablePublicIp + * @property {boolean|null} [enableOutboundPublicIp] InstanceNetworkConfig enableOutboundPublicIp */ /** - * Constructs a new ClientConnectionConfig. + * Constructs a new InstanceNetworkConfig. * @memberof google.cloud.alloydb.v1.Instance - * @classdesc Represents a ClientConnectionConfig. - * @implements IClientConnectionConfig + * @classdesc Represents an InstanceNetworkConfig. + * @implements IInstanceNetworkConfig * @constructor - * @param {google.cloud.alloydb.v1.Instance.IClientConnectionConfig=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.Instance.IInstanceNetworkConfig=} [properties] Properties to set */ - function ClientConnectionConfig(properties) { + function InstanceNetworkConfig(properties) { + this.authorizedExternalNetworks = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7480,89 +10580,106 @@ } /** - * ClientConnectionConfig requireConnectors. - * @member {boolean} requireConnectors - * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * InstanceNetworkConfig authorizedExternalNetworks. + * @member {Array.} authorizedExternalNetworks + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig * @instance */ - ClientConnectionConfig.prototype.requireConnectors = false; + InstanceNetworkConfig.prototype.authorizedExternalNetworks = $util.emptyArray; /** - * ClientConnectionConfig sslConfig. - * @member {google.cloud.alloydb.v1.ISslConfig|null|undefined} sslConfig - * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * InstanceNetworkConfig enablePublicIp. + * @member {boolean} enablePublicIp + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig * @instance */ - ClientConnectionConfig.prototype.sslConfig = null; + InstanceNetworkConfig.prototype.enablePublicIp = false; /** - * Creates a new ClientConnectionConfig instance using the specified properties. + * InstanceNetworkConfig enableOutboundPublicIp. + * @member {boolean} enableOutboundPublicIp + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig + * @instance + */ + InstanceNetworkConfig.prototype.enableOutboundPublicIp = false; + + /** + * Creates a new InstanceNetworkConfig instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig * @static - * @param {google.cloud.alloydb.v1.Instance.IClientConnectionConfig=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Instance.ClientConnectionConfig} ClientConnectionConfig instance + * @param {google.cloud.alloydb.v1.Instance.IInstanceNetworkConfig=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig} InstanceNetworkConfig instance */ - ClientConnectionConfig.create = function create(properties) { - return new ClientConnectionConfig(properties); + InstanceNetworkConfig.create = function create(properties) { + return new InstanceNetworkConfig(properties); }; /** - * Encodes the specified ClientConnectionConfig message. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ClientConnectionConfig.verify|verify} messages. + * 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.ClientConnectionConfig + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig * @static - * @param {google.cloud.alloydb.v1.Instance.IClientConnectionConfig} message ClientConnectionConfig message or plain object to encode + * @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 */ - ClientConnectionConfig.encode = function encode(message, writer) { + InstanceNetworkConfig.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(); + 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); return writer; }; /** - * Encodes the specified ClientConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Instance.ClientConnectionConfig.verify|verify} messages. + * 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.ClientConnectionConfig + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig * @static - * @param {google.cloud.alloydb.v1.Instance.IClientConnectionConfig} message ClientConnectionConfig message or plain object to encode + * @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 */ - ClientConnectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + InstanceNetworkConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ClientConnectionConfig message from the specified reader or buffer. + * Decodes an InstanceNetworkConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @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.ClientConnectionConfig} ClientConnectionConfig + * @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 */ - ClientConnectionConfig.decode = function decode(reader, length) { + InstanceNetworkConfig.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: { - message.requireConnectors = reader.bool(); + 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.sslConfig = $root.google.cloud.alloydb.v1.SslConfig.decode(reader, reader.uint32()); + message.enablePublicIp = reader.bool(); + break; + } + case 3: { + message.enableOutboundPublicIp = reader.bool(); break; } default: @@ -7574,116 +10691,340 @@ }; /** - * Decodes a ClientConnectionConfig message from the specified reader or buffer, length delimited. + * Decodes an InstanceNetworkConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @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.ClientConnectionConfig} ClientConnectionConfig + * @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 */ - ClientConnectionConfig.decodeDelimited = function decodeDelimited(reader) { + InstanceNetworkConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ClientConnectionConfig message. + * Verifies an InstanceNetworkConfig message. * @function verify - * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @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 */ - ClientConnectionConfig.verify = function verify(message) { + InstanceNetworkConfig.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; + 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"; return null; }; /** - * Creates a ClientConnectionConfig message from a plain object. Also converts values to their respective internal types. + * Creates an InstanceNetworkConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Instance.ClientConnectionConfig} ClientConnectionConfig + * @returns {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig} InstanceNetworkConfig */ - ClientConnectionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Instance.ClientConnectionConfig) + 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.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); + 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); return message; }; /** - * Creates a plain object from a ClientConnectionConfig message. Also converts values to other types if specified. + * Creates a plain object from an InstanceNetworkConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig * @static - * @param {google.cloud.alloydb.v1.Instance.ClientConnectionConfig} message ClientConnectionConfig + * @param {google.cloud.alloydb.v1.Instance.InstanceNetworkConfig} message InstanceNetworkConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ClientConnectionConfig.toObject = function toObject(message, options) { + InstanceNetworkConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.authorizedExternalNetworks = []; if (options.defaults) { - object.requireConnectors = false; - object.sslConfig = null; + object.enablePublicIp = false; + object.enableOutboundPublicIp = false; } - 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); + 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; return object; }; /** - * Converts this ClientConnectionConfig to JSON. + * Converts this InstanceNetworkConfig to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.Instance.ClientConnectionConfig + * @memberof google.cloud.alloydb.v1.Instance.InstanceNetworkConfig * @instance * @returns {Object.} JSON object */ - ClientConnectionConfig.prototype.toJSON = function toJSON() { + InstanceNetworkConfig.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"; - }; + /** + * 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) { + 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(); + 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 ClientConnectionConfig; + return InstanceNetworkConfig; })(); /** @@ -7759,6 +11100,7 @@ * @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 */ @@ -7793,6 +11135,14 @@ */ ConnectionInfo.prototype.ipAddress = ""; + /** + * ConnectionInfo publicIpAddress. + * @member {string} publicIpAddress + * @memberof google.cloud.alloydb.v1.ConnectionInfo + * @instance + */ + ConnectionInfo.prototype.publicIpAddress = ""; + /** * ConnectionInfo instanceUid. * @member {string} instanceUid @@ -7831,6 +11181,8 @@ 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; }; @@ -7861,7 +11213,495 @@ ConnectionInfo.decode = function decode(reader, length) { 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(); + 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(); + 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 {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 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(); + 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) { + 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(); switch (tag >>> 3) { @@ -7870,11 +11710,148 @@ break; } case 2: { - message.ipAddress = reader.string(); + message.displayName = reader.string(); + break; + } + case 3: { + message.uid = reader.string(); break; } case 4: { - message.instanceUid = reader.string(); + 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 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: @@ -7886,557 +11863,959 @@ }; /** - * Decodes a ConnectionInfo message from the specified reader or buffer, length delimited. + * Decodes a Backup message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ConnectionInfo + * @memberof google.cloud.alloydb.v1.Backup * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ConnectionInfo} ConnectionInfo + * @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 */ - ConnectionInfo.decodeDelimited = function decodeDelimited(reader) { + Backup.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ConnectionInfo message. + * Verifies a Backup message. * @function verify - * @memberof google.cloud.alloydb.v1.ConnectionInfo + * @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 */ - ConnectionInfo.verify = function verify(message) { + 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.ipAddress != null && message.hasOwnProperty("ipAddress")) - if (!$util.isString(message.ipAddress)) - return "ipAddress: string expected"; - if (message.instanceUid != null && message.hasOwnProperty("instanceUid")) - if (!$util.isString(message.instanceUid)) - return "instanceUid: 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: + 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: + 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 ConnectionInfo message from a plain object. Also converts values to their respective internal types. + * Creates a Backup message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.ConnectionInfo + * @memberof google.cloud.alloydb.v1.Backup * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ConnectionInfo} ConnectionInfo + * @returns {google.cloud.alloydb.v1.Backup} Backup */ - ConnectionInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ConnectionInfo) + Backup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Backup) return object; - var message = new $root.google.cloud.alloydb.v1.ConnectionInfo(); + var message = new $root.google.cloud.alloydb.v1.Backup(); if (object.name != null) message.name = String(object.name); - if (object.ipAddress != null) - message.ipAddress = String(object.ipAddress); - if (object.instanceUid != null) - message.instanceUid = String(object.instanceUid); + 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.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; + } + 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 ConnectionInfo message. Also converts values to other types if specified. + * Creates a plain object from a Backup message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.ConnectionInfo + * @memberof google.cloud.alloydb.v1.Backup * @static - * @param {google.cloud.alloydb.v1.ConnectionInfo} message ConnectionInfo + * @param {google.cloud.alloydb.v1.Backup} message Backup * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ConnectionInfo.toObject = function toObject(message, options) { + 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.ipAddress = ""; - object.instanceUid = ""; + 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; + } + 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.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; return object; }; /** - * Converts this ConnectionInfo to JSON. + * Converts this Backup to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.ConnectionInfo + * @memberof google.cloud.alloydb.v1.Backup * @instance * @returns {Object.} JSON object */ - ConnectionInfo.prototype.toJSON = function toJSON() { + Backup.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ConnectionInfo + * Gets the default type url for Backup * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ConnectionInfo + * @memberof google.cloud.alloydb.v1.Backup * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ConnectionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ConnectionInfo"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.Backup"; }; - return ConnectionInfo; - })(); + Backup.QuantityBasedExpiry = (function() { - v1.Backup = (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 + */ - /** - * 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 {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 {google.cloud.alloydb.v1.DatabaseVersion|null} [databaseVersion] Backup databaseVersion - */ + /** + * 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]]; + } - /** - * 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 = {}; - if (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; - /** - * Backup name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.name = ""; + /** + * QuantityBasedExpiry totalRetentionCount. + * @member {number} totalRetentionCount + * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @instance + */ + QuantityBasedExpiry.prototype.totalRetentionCount = 0; - /** - * Backup displayName. - * @member {string} displayName - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.displayName = ""; + /** + * 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); + }; - /** - * Backup uid. - * @member {string} uid - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.uid = ""; + /** + * 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; + }; - /** - * Backup createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.createTime = null; + /** + * 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(); + }; - /** - * Backup updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.updateTime = null; + /** + * 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) { + 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(); + 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; + }; - /** - * Backup deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.deleteTime = null; + /** + * 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()); + }; - /** - * Backup labels. - * @member {Object.} labels - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.labels = $util.emptyObject; + /** + * 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; + }; - /** - * Backup state. - * @member {google.cloud.alloydb.v1.Backup.State} state - * @memberof google.cloud.alloydb.v1.Backup - * @instance - */ - Backup.prototype.state = 0; + /** + * 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; + })(); /** - * Backup type. - * @member {google.cloud.alloydb.v1.Backup.Type} type - * @memberof google.cloud.alloydb.v1.Backup - * @instance + * 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.prototype.type = 0; + 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; + })(); /** - * Backup description. - * @member {string} description - * @memberof google.cloud.alloydb.v1.Backup - * @instance + * 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.prototype.description = ""; + 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() { /** - * Backup clusterUid. - * @member {string} clusterUid - * @memberof google.cloud.alloydb.v1.Backup - * @instance + * 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} [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 */ - Backup.prototype.clusterUid = ""; /** - * Backup clusterName. - * @member {string} clusterName - * @memberof google.cloud.alloydb.v1.Backup - * @instance + * 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 */ - Backup.prototype.clusterName = ""; + 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]]; + } /** - * Backup reconciling. - * @member {boolean} reconciling - * @memberof google.cloud.alloydb.v1.Backup + * SupportedDatabaseFlag stringRestrictions. + * @member {google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions|null|undefined} stringRestrictions + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @instance */ - Backup.prototype.reconciling = false; + SupportedDatabaseFlag.prototype.stringRestrictions = null; /** - * Backup encryptionConfig. - * @member {google.cloud.alloydb.v1.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.alloydb.v1.Backup + * SupportedDatabaseFlag integerRestrictions. + * @member {google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions|null|undefined} integerRestrictions + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @instance */ - Backup.prototype.encryptionConfig = null; + SupportedDatabaseFlag.prototype.integerRestrictions = null; /** - * Backup encryptionInfo. - * @member {google.cloud.alloydb.v1.IEncryptionInfo|null|undefined} encryptionInfo - * @memberof google.cloud.alloydb.v1.Backup + * SupportedDatabaseFlag name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @instance */ - Backup.prototype.encryptionInfo = null; + SupportedDatabaseFlag.prototype.name = ""; /** - * Backup etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1.Backup + * SupportedDatabaseFlag flagName. + * @member {string} flagName + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @instance */ - Backup.prototype.etag = ""; + SupportedDatabaseFlag.prototype.flagName = ""; /** - * Backup annotations. - * @member {Object.} annotations - * @memberof google.cloud.alloydb.v1.Backup + * SupportedDatabaseFlag valueType. + * @member {google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType} valueType + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @instance */ - Backup.prototype.annotations = $util.emptyObject; + SupportedDatabaseFlag.prototype.valueType = 0; /** - * Backup sizeBytes. - * @member {number|Long} sizeBytes - * @memberof google.cloud.alloydb.v1.Backup + * SupportedDatabaseFlag acceptsMultipleValues. + * @member {boolean} acceptsMultipleValues + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @instance */ - Backup.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + SupportedDatabaseFlag.prototype.acceptsMultipleValues = false; /** - * Backup expiryTime. - * @member {google.protobuf.ITimestamp|null|undefined} expiryTime - * @memberof google.cloud.alloydb.v1.Backup + * SupportedDatabaseFlag supportedDbVersions. + * @member {Array.} supportedDbVersions + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @instance */ - Backup.prototype.expiryTime = null; + SupportedDatabaseFlag.prototype.supportedDbVersions = $util.emptyArray; /** - * Backup expiryQuantity. - * @member {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry|null|undefined} expiryQuantity - * @memberof google.cloud.alloydb.v1.Backup + * SupportedDatabaseFlag requiresDbRestart. + * @member {boolean} requiresDbRestart + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @instance */ - Backup.prototype.expiryQuantity = null; + SupportedDatabaseFlag.prototype.requiresDbRestart = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Backup databaseVersion. - * @member {google.cloud.alloydb.v1.DatabaseVersion} databaseVersion - * @memberof google.cloud.alloydb.v1.Backup + * SupportedDatabaseFlag restrictions. + * @member {"stringRestrictions"|"integerRestrictions"|undefined} restrictions + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @instance */ - Backup.prototype.databaseVersion = 0; + Object.defineProperty(SupportedDatabaseFlag.prototype, "restrictions", { + get: $util.oneOfGetter($oneOfFields = ["stringRestrictions", "integerRestrictions"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new Backup instance using the specified properties. + * Creates a new SupportedDatabaseFlag instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.Backup + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @static - * @param {google.cloud.alloydb.v1.IBackup=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Backup} Backup instance + * @param {google.cloud.alloydb.v1.ISupportedDatabaseFlag=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag} SupportedDatabaseFlag instance */ - Backup.create = function create(properties) { - return new Backup(properties); + SupportedDatabaseFlag.create = function create(properties) { + return new SupportedDatabaseFlag(properties); }; /** - * Encodes the specified Backup message. Does not implicitly {@link google.cloud.alloydb.v1.Backup.verify|verify} messages. + * Encodes the specified SupportedDatabaseFlag message. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.Backup + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @static - * @param {google.cloud.alloydb.v1.IBackup} message Backup message or plain object to encode + * @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 */ - Backup.encode = function encode(message, 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.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.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) - writer.uint32(/* id 22, wireType 0 =*/176).int32(message.databaseVersion); + 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(); return writer; }; /** - * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Backup.verify|verify} messages. + * 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.Backup + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @static - * @param {google.cloud.alloydb.v1.IBackup} message Backup message or plain object to encode + * @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 */ - Backup.encodeDelimited = function encodeDelimited(message, writer) { + SupportedDatabaseFlag.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Backup message from the specified reader or buffer. + * Decodes a SupportedDatabaseFlag message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.Backup + * @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.Backup} Backup + * @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 */ - Backup.decode = function decode(reader, length) { + SupportedDatabaseFlag.decode = function decode(reader, length) { 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; + 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(); 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 1: { message.name = reader.string(); break; } case 2: { - message.displayName = reader.string(); + message.flagName = reader.string(); break; } case 3: { - message.uid = reader.string(); + message.valueType = reader.int32(); break; } case 4: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.acceptsMultipleValues = reader.bool(); 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()); + 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: { - 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 22: { - message.databaseVersion = reader.int32(); + message.requiresDbRestart = reader.bool(); break; } default: @@ -8448,68 +12827,61 @@ }; /** - * Decodes a Backup message from the specified reader or buffer, length delimited. + * Decodes a SupportedDatabaseFlag message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Backup + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Backup} Backup + * @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 */ - Backup.decodeDelimited = function decodeDelimited(reader) { + SupportedDatabaseFlag.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Backup message. + * Verifies a SupportedDatabaseFlag message. * @function verify - * @memberof google.cloud.alloydb.v1.Backup + * @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 */ - Backup.verify = function verify(message) { + 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.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) { + 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 "state: enum value expected"; + return "valueType: enum value expected"; case 0: case 1: case 2: @@ -8517,377 +12889,219 @@ 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.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: + break; + } } - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) - switch (message.databaseVersion) { - default: - return "databaseVersion: enum value expected"; - case 0: - case 1: - case 2: - break; - } + if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) + if (typeof message.requiresDbRestart !== "boolean") + return "requiresDbRestart: boolean expected"; return null; }; /** - * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * Creates a SupportedDatabaseFlag message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.Backup + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @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.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); + * @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.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.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); } - switch (object.databaseVersion) { + 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.databaseVersion === "number") { - message.databaseVersion = object.databaseVersion; + if (typeof object.valueType === "number") { + message.valueType = object.valueType; break; } break; - case "DATABASE_VERSION_UNSPECIFIED": + case "VALUE_TYPE_UNSPECIFIED": case 0: - message.databaseVersion = 0; + message.valueType = 0; break; - case "POSTGRES_13": + case "STRING": case 1: - message.databaseVersion = 1; + message.valueType = 1; break; - case "POSTGRES_14": + case "INTEGER": case 2: - message.databaseVersion = 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; + } + } + if (object.requiresDbRestart != null) + message.requiresDbRestart = Boolean(object.requiresDbRestart); return message; }; /** - * Creates a plain object from a Backup message. Also converts values to other types if specified. + * Creates a plain object from a SupportedDatabaseFlag message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.Backup + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @static - * @param {google.cloud.alloydb.v1.Backup} message Backup + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag} message SupportedDatabaseFlag * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Backup.toObject = function toObject(message, options) { + SupportedDatabaseFlag.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - } + if (options.arrays || options.defaults) + object.supportedDbVersions = []; 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.databaseVersion = options.enums === String ? "DATABASE_VERSION_UNSPECIFIED" : 0; + object.flagName = ""; + object.valueType = options.enums === String ? "VALUE_TYPE_UNSPECIFIED" : 0; + object.acceptsMultipleValues = false; + object.requiresDbRestart = false; } 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.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.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.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.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.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; return object; }; /** - * Converts this Backup to JSON. + * Converts this SupportedDatabaseFlag to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.Backup + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @instance * @returns {Object.} JSON object */ - Backup.prototype.toJSON = function toJSON() { + SupportedDatabaseFlag.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Backup + * Gets the default type url for SupportedDatabaseFlag * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Backup + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SupportedDatabaseFlag.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Backup"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.SupportedDatabaseFlag"; }; - Backup.QuantityBasedExpiry = (function() { + SupportedDatabaseFlag.StringRestrictions = (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 + * Properties of a StringRestrictions. + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @interface IStringRestrictions + * @property {Array.|null} [allowedValues] StringRestrictions allowedValues */ /** - * Constructs a new QuantityBasedExpiry. - * @memberof google.cloud.alloydb.v1.Backup - * @classdesc Represents a QuantityBasedExpiry. - * @implements IQuantityBasedExpiry + * Constructs a new StringRestrictions. + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @classdesc Represents a StringRestrictions. + * @implements IStringRestrictions * @constructor - * @param {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions=} [properties] Properties to set */ - function QuantityBasedExpiry(properties) { + function StringRestrictions(properties) { + this.allowedValues = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8895,89 +13109,308 @@ } /** - * QuantityBasedExpiry retentionCount. - * @member {number} retentionCount - * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * StringRestrictions allowedValues. + * @member {Array.} allowedValues + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions * @instance */ - QuantityBasedExpiry.prototype.retentionCount = 0; + StringRestrictions.prototype.allowedValues = $util.emptyArray; /** - * QuantityBasedExpiry totalRetentionCount. - * @member {number} totalRetentionCount - * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * 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) { + 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(); + 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 */ - QuantityBasedExpiry.prototype.totalRetentionCount = 0; + StringRestrictions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Creates a new QuantityBasedExpiry instance using the specified properties. + * 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.Backup.QuantityBasedExpiry + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions * @static - * @param {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.Backup.QuantityBasedExpiry} QuantityBasedExpiry instance + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions instance */ - QuantityBasedExpiry.create = function create(properties) { - return new QuantityBasedExpiry(properties); + IntegerRestrictions.create = function create(properties) { + return new IntegerRestrictions(properties); }; /** - * Encodes the specified QuantityBasedExpiry message. Does not implicitly {@link google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.verify|verify} messages. + * 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.Backup.QuantityBasedExpiry + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions * @static - * @param {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry} message QuantityBasedExpiry message or plain object to encode + * @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 */ - QuantityBasedExpiry.encode = function encode(message, writer) { + IntegerRestrictions.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); + 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 QuantityBasedExpiry message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.Backup.QuantityBasedExpiry.verify|verify} messages. + * 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.Backup.QuantityBasedExpiry + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions * @static - * @param {google.cloud.alloydb.v1.Backup.IQuantityBasedExpiry} message QuantityBasedExpiry message or plain object to encode + * @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 */ - QuantityBasedExpiry.encodeDelimited = function encodeDelimited(message, writer) { + IntegerRestrictions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a QuantityBasedExpiry message from the specified reader or buffer. + * Decodes an IntegerRestrictions message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @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.Backup.QuantityBasedExpiry} QuantityBasedExpiry + * @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 */ - QuantityBasedExpiry.decode = function decode(reader, length) { + IntegerRestrictions.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: { - message.retentionCount = reader.int32(); + message.minValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); break; } case 2: { - message.totalRetentionCount = reader.int32(); + message.maxValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); break; } default: @@ -8989,180 +13422,169 @@ }; /** - * Decodes a QuantityBasedExpiry message from the specified reader or buffer, length delimited. + * Decodes an IntegerRestrictions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.Backup.QuantityBasedExpiry} QuantityBasedExpiry + * @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 */ - QuantityBasedExpiry.decodeDelimited = function decodeDelimited(reader) { + IntegerRestrictions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a QuantityBasedExpiry message. + * Verifies an IntegerRestrictions message. * @function verify - * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @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 */ - QuantityBasedExpiry.verify = function verify(message) { + IntegerRestrictions.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"; + 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 a QuantityBasedExpiry message from a plain object. Also converts values to their respective internal types. + * Creates an IntegerRestrictions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.Backup.QuantityBasedExpiry} QuantityBasedExpiry + * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions} IntegerRestrictions */ - QuantityBasedExpiry.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.Backup.QuantityBasedExpiry) + 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.Backup.QuantityBasedExpiry(); - if (object.retentionCount != null) - message.retentionCount = object.retentionCount | 0; - if (object.totalRetentionCount != null) - message.totalRetentionCount = object.totalRetentionCount | 0; + 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 a QuantityBasedExpiry message. Also converts values to other types if specified. + * Creates a plain object from an IntegerRestrictions message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions * @static - * @param {google.cloud.alloydb.v1.Backup.QuantityBasedExpiry} message QuantityBasedExpiry + * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions} message IntegerRestrictions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - QuantityBasedExpiry.toObject = function toObject(message, options) { + IntegerRestrictions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.retentionCount = 0; - object.totalRetentionCount = 0; + object.minValue = null; + object.maxValue = null; } - if (message.retentionCount != null && message.hasOwnProperty("retentionCount")) - object.retentionCount = message.retentionCount; - if (message.totalRetentionCount != null && message.hasOwnProperty("totalRetentionCount")) - object.totalRetentionCount = message.totalRetentionCount; + 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 QuantityBasedExpiry to JSON. + * Converts this IntegerRestrictions to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions * @instance * @returns {Object.} JSON object */ - QuantityBasedExpiry.prototype.toJSON = function toJSON() { + IntegerRestrictions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for QuantityBasedExpiry + * Gets the default type url for IntegerRestrictions * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.Backup.QuantityBasedExpiry + * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - QuantityBasedExpiry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + IntegerRestrictions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.Backup.QuantityBasedExpiry"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions"; }; - 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; + return IntegerRestrictions; })(); /** - * Type enum. - * @name google.cloud.alloydb.v1.Backup.Type + * ValueType enum. + * @name google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType * @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 + * @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 */ - Backup.Type = (function() { + SupportedDatabaseFlag.ValueType = (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; + 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; })(); - return Backup; + return SupportedDatabaseFlag; })(); - v1.SupportedDatabaseFlag = (function() { + v1.User = (function() { /** - * Properties of a SupportedDatabaseFlag. + * Properties of a User. * @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} [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 + * @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 SupportedDatabaseFlag. + * Constructs a new User. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a SupportedDatabaseFlag. - * @implements ISupportedDatabaseFlag + * @classdesc Represents a User. + * @implements IUser * @constructor - * @param {google.cloud.alloydb.v1.ISupportedDatabaseFlag=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IUser=} [properties] Properties to set */ - function SupportedDatabaseFlag(properties) { - this.supportedDbVersions = []; + function User(properties) { + this.databaseRoles = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9170,198 +13592,453 @@ } /** - * SupportedDatabaseFlag stringRestrictions. - * @member {google.cloud.alloydb.v1.SupportedDatabaseFlag.IStringRestrictions|null|undefined} stringRestrictions - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * User name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.User * @instance */ - SupportedDatabaseFlag.prototype.stringRestrictions = null; + User.prototype.name = ""; /** - * SupportedDatabaseFlag integerRestrictions. - * @member {google.cloud.alloydb.v1.SupportedDatabaseFlag.IIntegerRestrictions|null|undefined} integerRestrictions - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * User password. + * @member {string} password + * @memberof google.cloud.alloydb.v1.User * @instance */ - SupportedDatabaseFlag.prototype.integerRestrictions = null; + User.prototype.password = ""; /** - * SupportedDatabaseFlag name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * User databaseRoles. + * @member {Array.} databaseRoles + * @memberof google.cloud.alloydb.v1.User * @instance */ - SupportedDatabaseFlag.prototype.name = ""; + User.prototype.databaseRoles = $util.emptyArray; /** - * SupportedDatabaseFlag flagName. - * @member {string} flagName - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * User userType. + * @member {google.cloud.alloydb.v1.User.UserType} userType + * @memberof google.cloud.alloydb.v1.User * @instance */ - SupportedDatabaseFlag.prototype.flagName = ""; + User.prototype.userType = 0; /** - * SupportedDatabaseFlag valueType. - * @member {google.cloud.alloydb.v1.SupportedDatabaseFlag.ValueType} valueType - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * User keepExtraRoles. + * @member {boolean} keepExtraRoles + * @memberof google.cloud.alloydb.v1.User * @instance */ - SupportedDatabaseFlag.prototype.valueType = 0; + User.prototype.keepExtraRoles = false; /** - * SupportedDatabaseFlag acceptsMultipleValues. - * @member {boolean} acceptsMultipleValues - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * 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) { + 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(); + 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 */ - SupportedDatabaseFlag.prototype.acceptsMultipleValues = false; + User.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * SupportedDatabaseFlag supportedDbVersions. - * @member {Array.} supportedDbVersions - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * 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 + */ + + /** + * 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 */ - SupportedDatabaseFlag.prototype.supportedDbVersions = $util.emptyArray; + Database.prototype.name = ""; /** - * SupportedDatabaseFlag requiresDbRestart. - * @member {boolean} requiresDbRestart - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * Database charset. + * @member {string} charset + * @memberof google.cloud.alloydb.v1.Database * @instance */ - SupportedDatabaseFlag.prototype.requiresDbRestart = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + Database.prototype.charset = ""; /** - * SupportedDatabaseFlag restrictions. - * @member {"stringRestrictions"|"integerRestrictions"|undefined} restrictions - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * Database collation. + * @member {string} collation + * @memberof google.cloud.alloydb.v1.Database * @instance */ - Object.defineProperty(SupportedDatabaseFlag.prototype, "restrictions", { - get: $util.oneOfGetter($oneOfFields = ["stringRestrictions", "integerRestrictions"]), - set: $util.oneOfSetter($oneOfFields) - }); + Database.prototype.collation = ""; /** - * Creates a new SupportedDatabaseFlag instance using the specified properties. + * Creates a new Database instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @memberof google.cloud.alloydb.v1.Database * @static - * @param {google.cloud.alloydb.v1.ISupportedDatabaseFlag=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag} SupportedDatabaseFlag instance + * @param {google.cloud.alloydb.v1.IDatabase=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.Database} Database instance */ - SupportedDatabaseFlag.create = function create(properties) { - return new SupportedDatabaseFlag(properties); + Database.create = function create(properties) { + return new Database(properties); }; /** - * Encodes the specified SupportedDatabaseFlag message. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.verify|verify} messages. + * Encodes the specified Database message. Does not implicitly {@link google.cloud.alloydb.v1.Database.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @memberof google.cloud.alloydb.v1.Database * @static - * @param {google.cloud.alloydb.v1.ISupportedDatabaseFlag} message SupportedDatabaseFlag message or plain object to encode + * @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 */ - SupportedDatabaseFlag.encode = function encode(message, 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.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.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); return writer; }; /** - * Encodes the specified SupportedDatabaseFlag message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.SupportedDatabaseFlag.verify|verify} messages. + * 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.SupportedDatabaseFlag + * @memberof google.cloud.alloydb.v1.Database * @static - * @param {google.cloud.alloydb.v1.ISupportedDatabaseFlag} message SupportedDatabaseFlag message or plain object to encode + * @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 */ - SupportedDatabaseFlag.encodeDelimited = function encodeDelimited(message, writer) { + Database.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SupportedDatabaseFlag message from the specified reader or buffer. + * Decodes a Database message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @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.SupportedDatabaseFlag} SupportedDatabaseFlag + * @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 */ - SupportedDatabaseFlag.decode = function decode(reader, length) { + Database.decode = function decode(reader, length) { 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(); + 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(); 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 1: { message.name = reader.string(); break; } case 2: { - message.flagName = reader.string(); + message.charset = 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(); + message.collation = reader.string(); break; } default: @@ -9373,2141 +14050,2436 @@ }; /** - * Decodes a SupportedDatabaseFlag message from the specified reader or buffer, length delimited. + * Decodes a Database message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @memberof google.cloud.alloydb.v1.Database * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag} SupportedDatabaseFlag + * @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 */ - SupportedDatabaseFlag.decodeDelimited = function decodeDelimited(reader) { + Database.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SupportedDatabaseFlag message. + * Verifies a Database message. * @function verify - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @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 */ - SupportedDatabaseFlag.verify = function verify(message) { + Database.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.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: - break; - } - } - if (message.requiresDbRestart != null && message.hasOwnProperty("requiresDbRestart")) - if (typeof message.requiresDbRestart !== "boolean") - return "requiresDbRestart: boolean 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"; return null; }; /** - * Creates a SupportedDatabaseFlag message from a plain object. Also converts values to their respective internal types. + * Creates a Database message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @memberof google.cloud.alloydb.v1.Database * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.SupportedDatabaseFlag} SupportedDatabaseFlag + * @returns {google.cloud.alloydb.v1.Database} Database */ - SupportedDatabaseFlag.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.SupportedDatabaseFlag) + Database.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.Database) 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); - } + var message = new $root.google.cloud.alloydb.v1.Database(); 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; - } - } - if (object.requiresDbRestart != null) - message.requiresDbRestart = Boolean(object.requiresDbRestart); + if (object.charset != null) + message.charset = String(object.charset); + if (object.collation != null) + message.collation = String(object.collation); return message; }; /** - * Creates a plain object from a SupportedDatabaseFlag message. Also converts values to other types if specified. + * Creates a plain object from a Database message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @memberof google.cloud.alloydb.v1.Database * @static - * @param {google.cloud.alloydb.v1.SupportedDatabaseFlag} message SupportedDatabaseFlag + * @param {google.cloud.alloydb.v1.Database} message Database * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SupportedDatabaseFlag.toObject = function toObject(message, options) { + Database.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.charset = ""; + object.collation = ""; } 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.charset != null && message.hasOwnProperty("charset")) + object.charset = message.charset; + if (message.collation != null && message.hasOwnProperty("collation")) + object.collation = message.collation; return object; }; /** - * Converts this SupportedDatabaseFlag to JSON. + * Converts this Database to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @memberof google.cloud.alloydb.v1.Database * @instance * @returns {Object.} JSON object */ - SupportedDatabaseFlag.prototype.toJSON = function toJSON() { + Database.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SupportedDatabaseFlag + * Gets the default type url for Database * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag + * @memberof google.cloud.alloydb.v1.Database * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SupportedDatabaseFlag.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Database.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.SupportedDatabaseFlag"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.Database"; }; - SupportedDatabaseFlag.StringRestrictions = (function() { + return Database; + })(); - /** - * Properties of a StringRestrictions. - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag - * @interface IStringRestrictions - * @property {Array.|null} [allowedValues] StringRestrictions allowedValues - */ + v1.AlloyDBAdmin = (function() { - /** - * 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]]; - } + /** + * 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); + } - /** - * StringRestrictions allowedValues. - * @member {Array.} allowedValues - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.StringRestrictions - * @instance - */ - StringRestrictions.prototype.allowedValues = $util.emptyArray; + (AlloyDBAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AlloyDBAdmin; - /** - * 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); - }; + /** + * 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); + }; - /** - * 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; - }; + /** + * 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 + */ - /** - * 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(); - }; + /** + * 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" }); - /** - * 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) { - 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(); - 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; - }; + /** + * 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 + */ - /** - * 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()); - }; + /** + * 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 + */ - /** - * 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; - }; + /** + * 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" }); - /** - * 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; - }; + /** + * 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 + */ - /** - * 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; - }; + /** + * 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 + */ - /** - * 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); - }; + /** + * 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" }); - /** - * 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"; - }; + /** + * 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 + */ - return StringRestrictions; - })(); + /** + * 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 + */ - SupportedDatabaseFlag.IntegerRestrictions = (function() { + /** + * 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" }); - /** - * 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 - */ + /** + * 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 + */ - /** - * 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]]; - } + /** + * 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 + */ - /** - * IntegerRestrictions minValue. - * @member {google.protobuf.IInt64Value|null|undefined} minValue - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions - * @instance - */ - IntegerRestrictions.prototype.minValue = null; + /** + * 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" }); - /** - * IntegerRestrictions maxValue. - * @member {google.protobuf.IInt64Value|null|undefined} maxValue - * @memberof google.cloud.alloydb.v1.SupportedDatabaseFlag.IntegerRestrictions - * @instance - */ - IntegerRestrictions.prototype.maxValue = null; + /** + * 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 + */ - /** - * 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); - }; + /** + * 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 + */ - /** - * 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; - }; + /** + * 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" }); - /** - * 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(); - }; + /** + * 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 + */ - /** - * 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) { - 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(); - 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; - }; + /** + * 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 + */ - /** - * 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()); - }; + /** + * 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" }); - /** - * 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; - }; + /** + * 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 + */ - /** - * 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; - }; + /** + * 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" }); - /** - * 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; - }; + /** + * 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 + */ - /** - * 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); - }; + /** + * 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 + */ - /** - * 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"; - }; + /** + * 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" }); - return IntegerRestrictions; - })(); + /** + * 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 + */ /** - * 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 + * 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 */ - 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; - })(); - return SupportedDatabaseFlag; - })(); + /** + * 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" }); - v1.User = (function() { + /** + * 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 + */ /** - * 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 + * 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 */ /** - * 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 + * 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 */ - 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]]; - } + 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" }); /** - * User name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.User + * 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 */ - User.prototype.name = ""; /** - * User password. - * @member {string} password - * @memberof google.cloud.alloydb.v1.User + * 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 */ - User.prototype.password = ""; + 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" }); /** - * User databaseRoles. - * @member {Array.} databaseRoles - * @memberof google.cloud.alloydb.v1.User + * 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 */ - User.prototype.databaseRoles = $util.emptyArray; /** - * User userType. - * @member {google.cloud.alloydb.v1.User.UserType} userType - * @memberof google.cloud.alloydb.v1.User + * 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 */ - User.prototype.userType = 0; + 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" }); /** - * 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 + * 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 */ - 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 + * 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 */ - 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); - 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 + * 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 */ - User.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + 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" }); /** - * 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 + * 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 */ - User.decode = function decode(reader, length) { - 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(); - 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; - } - 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 + * 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 */ - 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 + * 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 */ - 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; - } - return null; - }; + 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" }); /** - * 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 + * 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 */ - 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; - } - 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 + * 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 */ - 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; - } - 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; - return object; - }; /** - * Converts this User to JSON. - * @function toJSON - * @memberof google.cloud.alloydb.v1.User + * 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 - * @returns {Object.} JSON object + * @param {google.cloud.alloydb.v1.IRestartInstanceRequest} request RestartInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - 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 + * 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 */ - 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 + * 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 */ - 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; - })(); + 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" }); - v1.AlloyDBAdmin = (function() { + /** + * 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 + */ /** - * 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 + * 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 */ - function AlloyDBAdmin(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - (AlloyDBAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AlloyDBAdmin; + /** + * 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" }); /** - * Creates new AlloyDBAdmin service using the specified rpc implementation. - * @function create + * Calls ListBackups. + * @function listBackups * @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. + * @instance + * @param {google.cloud.alloydb.v1.IListBackupsRequest} request ListBackupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - AlloyDBAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; /** - * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listClusters}. + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getBackup}. * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef ListClustersCallback + * @typedef GetBackupCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1.ListClustersResponse} [response] ListClustersResponse + * @param {google.cloud.alloydb.v1.Backup} [response] Backup */ /** - * Calls ListClusters. - * @function listClusters + * Calls GetBackup. + * @function getBackup * @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 + * @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.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" }); + 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 ListClusters. - * @function listClusters + * Calls GetBackup. + * @function getBackup * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance - * @param {google.cloud.alloydb.v1.IListClustersRequest} request ListClustersRequest message or plain object - * @returns {Promise} Promise + * @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|getCluster}. + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createBackup}. * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef GetClusterCallback + * @typedef CreateBackupCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1.Cluster} [response] Cluster + * @param {google.longrunning.Operation} [response] Operation */ /** - * Calls GetCluster. - * @function getCluster + * Calls CreateBackup. + * @function createBackup * @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 + * @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.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" }); + 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 GetCluster. - * @function getCluster + * Calls CreateBackup. + * @function createBackup * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance - * @param {google.cloud.alloydb.v1.IGetClusterRequest} request GetClusterRequest message or plain object - * @returns {Promise} Promise + * @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|createCluster}. + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|updateBackup}. * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef CreateClusterCallback + * @typedef UpdateBackupCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.longrunning.Operation} [response] Operation */ /** - * Calls CreateCluster. - * @function createCluster + * Calls UpdateBackup. + * @function updateBackup * @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 + * @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.createCluster = function createCluster(request, callback) { - return this.rpcCall(createCluster, $root.google.cloud.alloydb.v1.CreateClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateCluster" }); + 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 CreateCluster. - * @function createCluster + * Calls UpdateBackup. + * @function updateBackup * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance - * @param {google.cloud.alloydb.v1.ICreateClusterRequest} request CreateClusterRequest message or plain object + * @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|updateCluster}. + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|deleteBackup}. * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef UpdateClusterCallback + * @typedef DeleteBackupCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.longrunning.Operation} [response] Operation */ /** - * Calls UpdateCluster. - * @function updateCluster + * Calls DeleteBackup. + * @function deleteBackup * @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 + * @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.updateCluster = function updateCluster(request, callback) { - return this.rpcCall(updateCluster, $root.google.cloud.alloydb.v1.UpdateClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateCluster" }); + 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 UpdateCluster. - * @function updateCluster + * Calls DeleteBackup. + * @function deleteBackup * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance - * @param {google.cloud.alloydb.v1.IUpdateClusterRequest} request UpdateClusterRequest message or plain object + * @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|deleteCluster}. + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listSupportedDatabaseFlags}. * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef DeleteClusterCallback + * @typedef ListSupportedDatabaseFlagsCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * @param {google.cloud.alloydb.v1.ListSupportedDatabaseFlagsResponse} [response] ListSupportedDatabaseFlagsResponse */ /** - * Calls DeleteCluster. - * @function deleteCluster + * Calls ListSupportedDatabaseFlags. + * @function listSupportedDatabaseFlags * @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 + * @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.deleteCluster = function deleteCluster(request, callback) { - return this.rpcCall(deleteCluster, $root.google.cloud.alloydb.v1.DeleteClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteCluster" }); + 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 DeleteCluster. - * @function deleteCluster + * Calls ListSupportedDatabaseFlags. + * @function listSupportedDatabaseFlags * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance - * @param {google.cloud.alloydb.v1.IDeleteClusterRequest} request DeleteClusterRequest message or plain object - * @returns {Promise} Promise + * @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|promoteCluster}. + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|generateClientCertificate}. * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef PromoteClusterCallback + * @typedef GenerateClientCertificateCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * @param {google.cloud.alloydb.v1.GenerateClientCertificateResponse} [response] GenerateClientCertificateResponse */ /** - * Calls PromoteCluster. - * @function promoteCluster + * Calls GenerateClientCertificate. + * @function generateClientCertificate * @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 + * @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.promoteCluster = function promoteCluster(request, callback) { - return this.rpcCall(promoteCluster, $root.google.cloud.alloydb.v1.PromoteClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "PromoteCluster" }); + 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 PromoteCluster. - * @function promoteCluster + * Calls GenerateClientCertificate. + * @function generateClientCertificate * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance - * @param {google.cloud.alloydb.v1.IPromoteClusterRequest} request PromoteClusterRequest message or plain object - * @returns {Promise} Promise + * @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|restoreCluster}. + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getConnectionInfo}. * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef RestoreClusterCallback + * @typedef GetConnectionInfoCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * @param {google.cloud.alloydb.v1.ConnectionInfo} [response] ConnectionInfo */ /** - * Calls RestoreCluster. - * @function restoreCluster + * Calls GetConnectionInfo. + * @function getConnectionInfo * @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 + * @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.restoreCluster = function restoreCluster(request, callback) { - return this.rpcCall(restoreCluster, $root.google.cloud.alloydb.v1.RestoreClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RestoreCluster" }); + 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 RestoreCluster. - * @function restoreCluster + * Calls GetConnectionInfo. + * @function getConnectionInfo * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance - * @param {google.cloud.alloydb.v1.IRestoreClusterRequest} request RestoreClusterRequest message or plain object - * @returns {Promise} Promise + * @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|createSecondaryCluster}. + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|listUsers}. * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef CreateSecondaryClusterCallback + * @typedef ListUsersCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * @param {google.cloud.alloydb.v1.ListUsersResponse} [response] ListUsersResponse */ /** - * Calls CreateSecondaryCluster. - * @function createSecondaryCluster + * Calls ListUsers. + * @function listUsers * @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 + * @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.createSecondaryCluster = function createSecondaryCluster(request, callback) { - return this.rpcCall(createSecondaryCluster, $root.google.cloud.alloydb.v1.CreateSecondaryClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateSecondaryCluster" }); + 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 CreateSecondaryCluster. - * @function createSecondaryCluster + * Calls ListUsers. + * @function listUsers * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance - * @param {google.cloud.alloydb.v1.ICreateSecondaryClusterRequest} request CreateSecondaryClusterRequest message or plain object - * @returns {Promise} Promise + * @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|listInstances}. + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|getUser}. * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef ListInstancesCallback + * @typedef GetUserCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1.ListInstancesResponse} [response] ListInstancesResponse + * @param {google.cloud.alloydb.v1.User} [response] User */ /** - * Calls ListInstances. - * @function listInstances + * Calls GetUser. + * @function getUser * @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 + * @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.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" }); + 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 ListInstances. - * @function listInstances + * Calls GetUser. + * @function getUser * @memberof google.cloud.alloydb.v1.AlloyDBAdmin * @instance - * @param {google.cloud.alloydb.v1.IListInstancesRequest} request ListInstancesRequest message or plain object - * @returns {Promise} Promise + * @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|getInstance}. + * Callback as used by {@link google.cloud.alloydb.v1.AlloyDBAdmin|createUser}. * @memberof google.cloud.alloydb.v1.AlloyDBAdmin - * @typedef GetInstanceCallback + * @typedef CreateUserCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.alloydb.v1.Instance} [response] Instance + * @param {google.cloud.alloydb.v1.User} [response] User */ /** - * Calls GetInstance. - * @function getInstance + * Calls CreateUser. + * @function createUser * @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 + * @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.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" }); + 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 = ""; /** - * Calls GetInstance. - * @function getInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * ListClustersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1.ListClustersRequest * @instance - * @param {google.cloud.alloydb.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + ListClustersRequest.prototype.pageSize = 0; /** - * 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 + * ListClustersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @instance */ + ListClustersRequest.prototype.pageToken = ""; /** - * Calls CreateInstance. - * @function createInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * ListClustersRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1.ListClustersRequest * @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" }); + ListClustersRequest.prototype.filter = ""; /** - * Calls CreateInstance. - * @function createInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * ListClustersRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.alloydb.v1.ListClustersRequest * @instance - * @param {google.cloud.alloydb.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + ListClustersRequest.prototype.orderBy = ""; /** - * 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 + * 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); + }; /** - * 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 + * 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 */ - 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" }); + 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; + }; /** - * 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 + * 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(); + }; /** - * 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 + * 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) { + 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(); + 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; + }; /** - * 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 + * 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 */ - 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" }); + ListClustersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * 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 + * 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; + }; /** - * 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 + * 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; + }; /** - * 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 + * 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 */ - 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" }); + 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; + }; /** - * Calls UpdateInstance. - * @function updateInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * Converts this ListClustersRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.ListClustersRequest * @instance - * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + ListClustersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * 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 + * 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"; + }; - /** - * 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" }); + return ListClustersRequest; + })(); + + v1.ListClustersResponse = (function() { /** - * 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 + * 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 */ /** - * 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 + * 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]]; + } /** - * Calls FailoverInstance. - * @function failoverInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * ListClustersResponse clusters. + * @member {Array.} clusters + * @memberof google.cloud.alloydb.v1.ListClustersResponse * @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" }); + ListClustersResponse.prototype.clusters = $util.emptyArray; /** - * Calls FailoverInstance. - * @function failoverInstance - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * ListClustersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1.ListClustersResponse * @instance - * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest} request FailoverInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + ListClustersResponse.prototype.nextPageToken = ""; /** - * 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 + * ListClustersResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @instance */ + ListClustersResponse.prototype.unreachable = $util.emptyArray; /** - * 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 + * 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 */ - 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" }); + ListClustersResponse.create = function create(properties) { + return new ListClustersResponse(properties); + }; /** - * 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 + * 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; + }; /** - * 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 + * 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(); + }; /** - * 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 + * 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 */ - 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" }); + ListClustersResponse.decode = function decode(reader, length) { + 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(); + 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; + }; /** - * 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 + * 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()); + }; /** - * 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 + * 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; + }; /** - * 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 + * 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 */ - 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" }); + 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; + }; /** - * 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 + * 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; + }; /** - * 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 + * 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); + }; /** - * 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 + * 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 */ - 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" }); + ListClustersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.alloydb.v1.ListClustersResponse"; + }; + + return ListClustersResponse; + })(); + + v1.GetClusterRequest = (function() { /** - * 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 + * 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 */ /** - * 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 + * 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]]; + } /** - * Calls CreateBackup. - * @function createBackup - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * GetClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.GetClusterRequest * @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" }); + GetClusterRequest.prototype.name = ""; /** - * Calls CreateBackup. - * @function createBackup - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * GetClusterRequest view. + * @member {google.cloud.alloydb.v1.ClusterView} view + * @memberof google.cloud.alloydb.v1.GetClusterRequest * @instance - * @param {google.cloud.alloydb.v1.ICreateBackupRequest} request CreateBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + GetClusterRequest.prototype.view = 0; /** - * 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 + * 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); + }; /** - * 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 + * 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 */ - 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" }); + 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; + }; /** - * 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 + * 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(); + }; /** - * 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 + * 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) { + 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(); + 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; + }; /** - * 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 + * 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 */ - 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" }); + GetClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * 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 + * 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; + }; /** - * 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 + * 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; + }; /** - * 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 + * 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 */ - 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" }); + 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; + }; /** - * Calls ListSupportedDatabaseFlags. - * @function listSupportedDatabaseFlags - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * Converts this GetClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.GetClusterRequest * @instance - * @param {google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest} request ListSupportedDatabaseFlagsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + GetClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * 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 + * 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"; + }; - /** - * 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" }); + return GetClusterRequest; + })(); - /** - * 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 - */ + v1.CreateSecondaryClusterRequest = (function() { /** - * 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 + * 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 */ /** - * 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 + * 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 */ - 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" }); + 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]]; + } /** - * Calls GetConnectionInfo. - * @function getConnectionInfo - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * CreateSecondaryClusterRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest * @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 */ + CreateSecondaryClusterRequest.prototype.parent = ""; /** - * Calls ListUsers. - * @function listUsers - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * CreateSecondaryClusterRequest clusterId. + * @member {string} clusterId + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest * @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" }); + CreateSecondaryClusterRequest.prototype.clusterId = ""; /** - * Calls ListUsers. - * @function listUsers - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * CreateSecondaryClusterRequest cluster. + * @member {google.cloud.alloydb.v1.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest * @instance - * @param {google.cloud.alloydb.v1.IListUsersRequest} request ListUsersRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + CreateSecondaryClusterRequest.prototype.cluster = null; /** - * 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 + * CreateSecondaryClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest + * @instance */ + CreateSecondaryClusterRequest.prototype.requestId = ""; /** - * Calls GetUser. - * @function getUser - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * CreateSecondaryClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest * @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" }); + CreateSecondaryClusterRequest.prototype.validateOnly = false; /** - * 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 + * 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); + }; /** - * 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 + * 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; + }; /** - * 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 + * 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 */ - 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" }); + CreateSecondaryClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * 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 + * 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) { + 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(); + 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; + }; /** - * 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 + * 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()); + }; /** - * 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 + * 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 */ - 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" }); + 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; + }; /** - * 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 + * 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; + }; /** - * 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 + * 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; + }; /** - * Calls DeleteUser. - * @function deleteUser - * @memberof google.cloud.alloydb.v1.AlloyDBAdmin + * Converts this CreateSecondaryClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest * @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 + * @returns {Object.} JSON object */ - 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" }); + CreateSecondaryClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * 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 + * 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 AlloyDBAdmin; + return CreateSecondaryClusterRequest; })(); - v1.ListClustersRequest = (function() { + v1.CreateClusterRequest = (function() { /** - * Properties of a ListClustersRequest. + * Properties of a CreateClusterRequest. * @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 + * @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 ListClustersRequest. + * Constructs a new CreateClusterRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ListClustersRequest. - * @implements IListClustersRequest + * @classdesc Represents a CreateClusterRequest. + * @implements ICreateClusterRequest * @constructor - * @param {google.cloud.alloydb.v1.IListClustersRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.ICreateClusterRequest=} [properties] Properties to set */ - function ListClustersRequest(properties) { + function CreateClusterRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11515,110 +16487,110 @@ } /** - * ListClustersRequest parent. + * CreateClusterRequest parent. * @member {string} parent - * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @memberof google.cloud.alloydb.v1.CreateClusterRequest * @instance */ - ListClustersRequest.prototype.parent = ""; + CreateClusterRequest.prototype.parent = ""; /** - * ListClustersRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1.ListClustersRequest + * CreateClusterRequest clusterId. + * @member {string} clusterId + * @memberof google.cloud.alloydb.v1.CreateClusterRequest * @instance */ - ListClustersRequest.prototype.pageSize = 0; + CreateClusterRequest.prototype.clusterId = ""; /** - * ListClustersRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1.ListClustersRequest + * CreateClusterRequest cluster. + * @member {google.cloud.alloydb.v1.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1.CreateClusterRequest * @instance */ - ListClustersRequest.prototype.pageToken = ""; + CreateClusterRequest.prototype.cluster = null; /** - * ListClustersRequest filter. - * @member {string} filter - * @memberof google.cloud.alloydb.v1.ListClustersRequest + * CreateClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.CreateClusterRequest * @instance */ - ListClustersRequest.prototype.filter = ""; + CreateClusterRequest.prototype.requestId = ""; /** - * ListClustersRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.alloydb.v1.ListClustersRequest + * CreateClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.CreateClusterRequest * @instance */ - ListClustersRequest.prototype.orderBy = ""; + CreateClusterRequest.prototype.validateOnly = false; /** - * Creates a new ListClustersRequest instance using the specified properties. + * Creates a new CreateClusterRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @memberof google.cloud.alloydb.v1.CreateClusterRequest * @static - * @param {google.cloud.alloydb.v1.IListClustersRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ListClustersRequest} ListClustersRequest instance + * @param {google.cloud.alloydb.v1.ICreateClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.CreateClusterRequest} CreateClusterRequest instance */ - ListClustersRequest.create = function create(properties) { - return new ListClustersRequest(properties); + CreateClusterRequest.create = function create(properties) { + return new CreateClusterRequest(properties); }; /** - * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersRequest.verify|verify} messages. + * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateClusterRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @memberof google.cloud.alloydb.v1.CreateClusterRequest * @static - * @param {google.cloud.alloydb.v1.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @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 */ - ListClustersRequest.encode = function encode(message, 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.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); + 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 ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersRequest.verify|verify} messages. + * 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.ListClustersRequest + * @memberof google.cloud.alloydb.v1.CreateClusterRequest * @static - * @param {google.cloud.alloydb.v1.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @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 */ - ListClustersRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListClustersRequest message from the specified reader or buffer. + * Decodes a CreateClusterRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @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.ListClustersRequest} ListClustersRequest + * @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 */ - ListClustersRequest.decode = function decode(reader, length) { + CreateClusterRequest.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { @@ -11627,19 +16599,19 @@ break; } case 2: { - message.pageSize = reader.int32(); + message.clusterId = reader.string(); break; } case 3: { - message.pageToken = reader.string(); + message.cluster = $root.google.cloud.alloydb.v1.Cluster.decode(reader, reader.uint32()); break; } case 4: { - message.filter = reader.string(); + message.requestId = reader.string(); break; } case 5: { - message.orderBy = reader.string(); + message.validateOnly = reader.bool(); break; } default: @@ -11651,159 +16623,164 @@ }; /** - * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @memberof google.cloud.alloydb.v1.CreateClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ListClustersRequest} ListClustersRequest + * @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 */ - ListClustersRequest.decodeDelimited = function decodeDelimited(reader) { + CreateClusterRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListClustersRequest message. + * Verifies a CreateClusterRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @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 */ - ListClustersRequest.verify = function verify(message) { + 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.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"; + 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 ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @memberof google.cloud.alloydb.v1.CreateClusterRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ListClustersRequest} ListClustersRequest + * @returns {google.cloud.alloydb.v1.CreateClusterRequest} CreateClusterRequest */ - ListClustersRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ListClustersRequest) + CreateClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.CreateClusterRequest) return object; - var message = new $root.google.cloud.alloydb.v1.ListClustersRequest(); + var message = new $root.google.cloud.alloydb.v1.CreateClusterRequest(); 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); + 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 ListClustersRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @memberof google.cloud.alloydb.v1.CreateClusterRequest * @static - * @param {google.cloud.alloydb.v1.ListClustersRequest} message ListClustersRequest + * @param {google.cloud.alloydb.v1.CreateClusterRequest} message CreateClusterRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListClustersRequest.toObject = function toObject(message, options) { + CreateClusterRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; + object.clusterId = ""; + object.cluster = null; + object.requestId = ""; + object.validateOnly = false; } 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; + 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 ListClustersRequest to JSON. + * Converts this CreateClusterRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @memberof google.cloud.alloydb.v1.CreateClusterRequest * @instance * @returns {Object.} JSON object */ - ListClustersRequest.prototype.toJSON = function toJSON() { + CreateClusterRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListClustersRequest + * Gets the default type url for CreateClusterRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ListClustersRequest + * @memberof google.cloud.alloydb.v1.CreateClusterRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListClustersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ListClustersRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateClusterRequest"; }; - return ListClustersRequest; + return CreateClusterRequest; })(); - v1.ListClustersResponse = (function() { + v1.UpdateClusterRequest = (function() { /** - * Properties of a ListClustersResponse. + * Properties of an UpdateClusterRequest. * @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 + * @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 ListClustersResponse. + * Constructs a new UpdateClusterRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ListClustersResponse. - * @implements IListClustersResponse + * @classdesc Represents an UpdateClusterRequest. + * @implements IUpdateClusterRequest * @constructor - * @param {google.cloud.alloydb.v1.IListClustersResponse=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IUpdateClusterRequest=} [properties] Properties to set */ - function ListClustersResponse(properties) { - this.clusters = []; - this.unreachable = []; + function UpdateClusterRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11811,109 +16788,131 @@ } /** - * ListClustersResponse clusters. - * @member {Array.} clusters - * @memberof google.cloud.alloydb.v1.ListClustersResponse + * UpdateClusterRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest * @instance */ - ListClustersResponse.prototype.clusters = $util.emptyArray; + UpdateClusterRequest.prototype.updateMask = null; /** - * ListClustersResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1.ListClustersResponse + * UpdateClusterRequest cluster. + * @member {google.cloud.alloydb.v1.ICluster|null|undefined} cluster + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest * @instance */ - ListClustersResponse.prototype.nextPageToken = ""; + UpdateClusterRequest.prototype.cluster = null; /** - * ListClustersResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.alloydb.v1.ListClustersResponse + * UpdateClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest * @instance */ - ListClustersResponse.prototype.unreachable = $util.emptyArray; + UpdateClusterRequest.prototype.requestId = ""; /** - * Creates a new ListClustersResponse instance using the specified properties. + * 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.ListClustersResponse + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest * @static - * @param {google.cloud.alloydb.v1.IListClustersResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ListClustersResponse} ListClustersResponse instance + * @param {google.cloud.alloydb.v1.IUpdateClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.UpdateClusterRequest} UpdateClusterRequest instance */ - ListClustersResponse.create = function create(properties) { - return new ListClustersResponse(properties); + UpdateClusterRequest.create = function create(properties) { + return new UpdateClusterRequest(properties); }; /** - * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersResponse.verify|verify} messages. + * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateClusterRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest * @static - * @param {google.cloud.alloydb.v1.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @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 */ - ListClustersResponse.encode = function encode(message, writer) { + UpdateClusterRequest.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]); + 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 ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListClustersResponse.verify|verify} messages. + * 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.ListClustersResponse + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest * @static - * @param {google.cloud.alloydb.v1.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @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 */ - ListClustersResponse.encodeDelimited = function encodeDelimited(message, writer) { + UpdateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListClustersResponse message from the specified reader or buffer. + * Decodes an UpdateClusterRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @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.ListClustersResponse} ListClustersResponse + * @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 */ - ListClustersResponse.decode = function decode(reader, length) { + UpdateClusterRequest.decode = function decode(reader, length) { 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(); + 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(); 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())); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } case 2: { - message.nextPageToken = reader.string(); + message.cluster = $root.google.cloud.alloydb.v1.Cluster.decode(reader, reader.uint32()); break; } case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.allowMissing = reader.bool(); break; } default: @@ -11925,170 +16924,169 @@ }; /** - * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ListClustersResponse} ListClustersResponse + * @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 */ - ListClustersResponse.decodeDelimited = function decodeDelimited(reader) { + UpdateClusterRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListClustersResponse message. + * Verifies an UpdateClusterRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @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 */ - ListClustersResponse.verify = function verify(message) { + UpdateClusterRequest.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.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + 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"; + 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 a ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ListClustersResponse} ListClustersResponse + * @returns {google.cloud.alloydb.v1.UpdateClusterRequest} UpdateClusterRequest */ - ListClustersResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ListClustersResponse) + UpdateClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.UpdateClusterRequest) 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]); - } + 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.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]); + 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 a ListClustersResponse message. Also converts values to other types if specified. + * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest * @static - * @param {google.cloud.alloydb.v1.ListClustersResponse} message ListClustersResponse + * @param {google.cloud.alloydb.v1.UpdateClusterRequest} message UpdateClusterRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListClustersResponse.toObject = function toObject(message, options) { + UpdateClusterRequest.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]; + 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 ListClustersResponse to JSON. + * Converts this UpdateClusterRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest * @instance * @returns {Object.} JSON object */ - ListClustersResponse.prototype.toJSON = function toJSON() { + UpdateClusterRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListClustersResponse + * Gets the default type url for UpdateClusterRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ListClustersResponse + * @memberof google.cloud.alloydb.v1.UpdateClusterRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListClustersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ListClustersResponse"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.UpdateClusterRequest"; }; - return ListClustersResponse; + return UpdateClusterRequest; })(); - v1.GetClusterRequest = (function() { + v1.DeleteClusterRequest = (function() { /** - * Properties of a GetClusterRequest. + * Properties of a DeleteClusterRequest. * @memberof google.cloud.alloydb.v1 - * @interface IGetClusterRequest - * @property {string|null} [name] GetClusterRequest name - * @property {google.cloud.alloydb.v1.ClusterView|null} [view] GetClusterRequest view + * @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 GetClusterRequest. + * Constructs a new DeleteClusterRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a GetClusterRequest. - * @implements IGetClusterRequest + * @classdesc Represents a DeleteClusterRequest. + * @implements IDeleteClusterRequest * @constructor - * @param {google.cloud.alloydb.v1.IGetClusterRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IDeleteClusterRequest=} [properties] Properties to set */ - function GetClusterRequest(properties) { + function DeleteClusterRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12096,80 +17094,110 @@ } /** - * GetClusterRequest name. + * DeleteClusterRequest name. * @member {string} name - * @memberof google.cloud.alloydb.v1.GetClusterRequest + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest * @instance */ - GetClusterRequest.prototype.name = ""; + DeleteClusterRequest.prototype.name = ""; /** - * GetClusterRequest view. - * @member {google.cloud.alloydb.v1.ClusterView} view - * @memberof google.cloud.alloydb.v1.GetClusterRequest + * DeleteClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest * @instance */ - GetClusterRequest.prototype.view = 0; + DeleteClusterRequest.prototype.requestId = ""; /** - * Creates a new GetClusterRequest instance using the specified properties. + * 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.GetClusterRequest + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest * @static - * @param {google.cloud.alloydb.v1.IGetClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.GetClusterRequest} GetClusterRequest instance + * @param {google.cloud.alloydb.v1.IDeleteClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.DeleteClusterRequest} DeleteClusterRequest instance */ - GetClusterRequest.create = function create(properties) { - return new GetClusterRequest(properties); + DeleteClusterRequest.create = function create(properties) { + return new DeleteClusterRequest(properties); }; /** - * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetClusterRequest.verify|verify} messages. + * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteClusterRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.GetClusterRequest + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest * @static - * @param {google.cloud.alloydb.v1.IGetClusterRequest} message GetClusterRequest message or plain object to encode + * @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 */ - GetClusterRequest.encode = function encode(message, 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.view != null && Object.hasOwnProperty.call(message, "view")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + 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 GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetClusterRequest.verify|verify} messages. + * 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.GetClusterRequest + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest * @static - * @param {google.cloud.alloydb.v1.IGetClusterRequest} message GetClusterRequest message or plain object to encode + * @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 */ - GetClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetClusterRequest message from the specified reader or buffer. + * Decodes a DeleteClusterRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.GetClusterRequest + * @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.GetClusterRequest} GetClusterRequest + * @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 */ - GetClusterRequest.decode = function decode(reader, length) { + DeleteClusterRequest.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { @@ -12178,7 +17206,19 @@ break; } case 2: { - message.view = reader.int32(); + 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: @@ -12190,159 +17230,157 @@ }; /** - * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.GetClusterRequest + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.GetClusterRequest} GetClusterRequest + * @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 */ - GetClusterRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteClusterRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetClusterRequest message. + * Verifies a DeleteClusterRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.GetClusterRequest + * @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 */ - GetClusterRequest.verify = function verify(message) { + 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.view != null && message.hasOwnProperty("view")) - switch (message.view) { - default: - return "view: enum value expected"; - case 0: - case 1: - case 2: - break; - } + 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 GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.GetClusterRequest + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.GetClusterRequest} GetClusterRequest + * @returns {google.cloud.alloydb.v1.DeleteClusterRequest} DeleteClusterRequest */ - GetClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.GetClusterRequest) + DeleteClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.DeleteClusterRequest) return object; - var message = new $root.google.cloud.alloydb.v1.GetClusterRequest(); + var message = new $root.google.cloud.alloydb.v1.DeleteClusterRequest(); 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; - } + 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 GetClusterRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.GetClusterRequest + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest * @static - * @param {google.cloud.alloydb.v1.GetClusterRequest} message GetClusterRequest + * @param {google.cloud.alloydb.v1.DeleteClusterRequest} message DeleteClusterRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetClusterRequest.toObject = function toObject(message, options) { + DeleteClusterRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; - object.view = options.enums === String ? "CLUSTER_VIEW_UNSPECIFIED" : 0; + object.requestId = ""; + object.etag = ""; + object.validateOnly = false; + object.force = false; } 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; + 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 GetClusterRequest to JSON. + * Converts this DeleteClusterRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.GetClusterRequest + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest * @instance * @returns {Object.} JSON object */ - GetClusterRequest.prototype.toJSON = function toJSON() { + DeleteClusterRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetClusterRequest + * Gets the default type url for DeleteClusterRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.GetClusterRequest + * @memberof google.cloud.alloydb.v1.DeleteClusterRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.GetClusterRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.DeleteClusterRequest"; }; - return GetClusterRequest; + return DeleteClusterRequest; })(); - v1.CreateSecondaryClusterRequest = (function() { + v1.SwitchoverClusterRequest = (function() { /** - * Properties of a CreateSecondaryClusterRequest. + * Properties of a SwitchoverClusterRequest. * @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 + * @interface ISwitchoverClusterRequest + * @property {string|null} [name] SwitchoverClusterRequest name + * @property {string|null} [requestId] SwitchoverClusterRequest requestId + * @property {boolean|null} [validateOnly] SwitchoverClusterRequest validateOnly */ /** - * Constructs a new CreateSecondaryClusterRequest. + * Constructs a new SwitchoverClusterRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a CreateSecondaryClusterRequest. - * @implements ICreateSecondaryClusterRequest + * @classdesc Represents a SwitchoverClusterRequest. + * @implements ISwitchoverClusterRequest * @constructor - * @param {google.cloud.alloydb.v1.ICreateSecondaryClusterRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.ISwitchoverClusterRequest=} [properties] Properties to set */ - function CreateSecondaryClusterRequest(properties) { + function SwitchoverClusterRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12350,130 +17388,102 @@ } /** - * 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 + * SwitchoverClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest * @instance */ - CreateSecondaryClusterRequest.prototype.cluster = null; + SwitchoverClusterRequest.prototype.name = ""; /** - * CreateSecondaryClusterRequest requestId. + * SwitchoverClusterRequest requestId. * @member {string} requestId - * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest + * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest * @instance */ - CreateSecondaryClusterRequest.prototype.requestId = ""; + SwitchoverClusterRequest.prototype.requestId = ""; /** - * CreateSecondaryClusterRequest validateOnly. + * SwitchoverClusterRequest validateOnly. * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest + * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest * @instance */ - CreateSecondaryClusterRequest.prototype.validateOnly = false; + SwitchoverClusterRequest.prototype.validateOnly = false; /** - * Creates a new CreateSecondaryClusterRequest instance using the specified properties. + * Creates a new SwitchoverClusterRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest + * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest * @static - * @param {google.cloud.alloydb.v1.ICreateSecondaryClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest instance + * @param {google.cloud.alloydb.v1.ISwitchoverClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.SwitchoverClusterRequest} SwitchoverClusterRequest instance */ - CreateSecondaryClusterRequest.create = function create(properties) { - return new CreateSecondaryClusterRequest(properties); + SwitchoverClusterRequest.create = function create(properties) { + return new SwitchoverClusterRequest(properties); }; /** - * Encodes the specified CreateSecondaryClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryClusterRequest.verify|verify} messages. + * Encodes the specified SwitchoverClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.SwitchoverClusterRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest + * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest * @static - * @param {google.cloud.alloydb.v1.ICreateSecondaryClusterRequest} message CreateSecondaryClusterRequest message or plain object to encode + * @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 */ - CreateSecondaryClusterRequest.encode = function encode(message, writer) { + SwitchoverClusterRequest.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.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 5, wireType 2 =*/42).string(message.requestId); + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.validateOnly); + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); return writer; }; /** - * Encodes the specified CreateSecondaryClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryClusterRequest.verify|verify} messages. + * 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.CreateSecondaryClusterRequest + * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest * @static - * @param {google.cloud.alloydb.v1.ICreateSecondaryClusterRequest} message CreateSecondaryClusterRequest message or plain object to encode + * @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 */ - CreateSecondaryClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + SwitchoverClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer. + * Decodes a SwitchoverClusterRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest + * @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.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest + * @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 */ - CreateSecondaryClusterRequest.decode = function decode(reader, length) { + SwitchoverClusterRequest.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.name = 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: { + case 3: { message.validateOnly = reader.bool(); break; } @@ -12486,43 +17496,35 @@ }; /** - * Decodes a CreateSecondaryClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a SwitchoverClusterRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest + * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest + * @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 */ - CreateSecondaryClusterRequest.decodeDelimited = function decodeDelimited(reader) { + SwitchoverClusterRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateSecondaryClusterRequest message. + * Verifies a SwitchoverClusterRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest + * @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 */ - CreateSecondaryClusterRequest.verify = function verify(message) { + SwitchoverClusterRequest.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.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"; @@ -12533,26 +17535,19 @@ }; /** - * Creates a CreateSecondaryClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SwitchoverClusterRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest + * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.CreateSecondaryClusterRequest} CreateSecondaryClusterRequest + * @returns {google.cloud.alloydb.v1.SwitchoverClusterRequest} SwitchoverClusterRequest */ - CreateSecondaryClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.CreateSecondaryClusterRequest) + SwitchoverClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.SwitchoverClusterRequest) 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); - } + 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) @@ -12561,31 +17556,25 @@ }; /** - * Creates a plain object from a CreateSecondaryClusterRequest message. Also converts values to other types if specified. + * Creates a plain object from a SwitchoverClusterRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest + * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest * @static - * @param {google.cloud.alloydb.v1.CreateSecondaryClusterRequest} message CreateSecondaryClusterRequest + * @param {google.cloud.alloydb.v1.SwitchoverClusterRequest} message SwitchoverClusterRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateSecondaryClusterRequest.toObject = function toObject(message, options) { + SwitchoverClusterRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.clusterId = ""; - object.cluster = null; + object.name = ""; 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.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")) @@ -12594,56 +17583,55 @@ }; /** - * Converts this CreateSecondaryClusterRequest to JSON. + * Converts this SwitchoverClusterRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest + * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest * @instance * @returns {Object.} JSON object */ - CreateSecondaryClusterRequest.prototype.toJSON = function toJSON() { + SwitchoverClusterRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateSecondaryClusterRequest + * Gets the default type url for SwitchoverClusterRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.CreateSecondaryClusterRequest + * @memberof google.cloud.alloydb.v1.SwitchoverClusterRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateSecondaryClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SwitchoverClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateSecondaryClusterRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.SwitchoverClusterRequest"; }; - return CreateSecondaryClusterRequest; + return SwitchoverClusterRequest; })(); - v1.CreateClusterRequest = (function() { + v1.PromoteClusterRequest = (function() { /** - * Properties of a CreateClusterRequest. + * Properties of a PromoteClusterRequest. * @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 + * @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 CreateClusterRequest. + * Constructs a new PromoteClusterRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a CreateClusterRequest. - * @implements ICreateClusterRequest + * @classdesc Represents a PromoteClusterRequest. + * @implements IPromoteClusterRequest * @constructor - * @param {google.cloud.alloydb.v1.ICreateClusterRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IPromoteClusterRequest=} [properties] Properties to set */ - function CreateClusterRequest(properties) { + function PromoteClusterRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12651,130 +17639,116 @@ } /** - * 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 + * PromoteClusterRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest * @instance */ - CreateClusterRequest.prototype.clusterId = ""; + PromoteClusterRequest.prototype.name = ""; /** - * CreateClusterRequest cluster. - * @member {google.cloud.alloydb.v1.ICluster|null|undefined} cluster - * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * PromoteClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest * @instance */ - CreateClusterRequest.prototype.cluster = null; + PromoteClusterRequest.prototype.requestId = ""; /** - * CreateClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * PromoteClusterRequest etag. + * @member {string} etag + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest * @instance */ - CreateClusterRequest.prototype.requestId = ""; + PromoteClusterRequest.prototype.etag = ""; /** - * CreateClusterRequest validateOnly. + * PromoteClusterRequest validateOnly. * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest * @instance */ - CreateClusterRequest.prototype.validateOnly = false; + PromoteClusterRequest.prototype.validateOnly = false; /** - * Creates a new CreateClusterRequest instance using the specified properties. + * Creates a new PromoteClusterRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest * @static - * @param {google.cloud.alloydb.v1.ICreateClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.CreateClusterRequest} CreateClusterRequest instance + * @param {google.cloud.alloydb.v1.IPromoteClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.PromoteClusterRequest} PromoteClusterRequest instance */ - CreateClusterRequest.create = function create(properties) { - return new CreateClusterRequest(properties); + PromoteClusterRequest.create = function create(properties) { + return new PromoteClusterRequest(properties); }; /** - * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateClusterRequest.verify|verify} messages. + * Encodes the specified PromoteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.PromoteClusterRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest * @static - * @param {google.cloud.alloydb.v1.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @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 */ - CreateClusterRequest.encode = function encode(message, writer) { + PromoteClusterRequest.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.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 4, wireType 2 =*/34).string(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 5, wireType 0 =*/40).bool(message.validateOnly); + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); return writer; }; /** - * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateClusterRequest.verify|verify} messages. + * 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.CreateClusterRequest + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest * @static - * @param {google.cloud.alloydb.v1.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @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 */ - CreateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + PromoteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateClusterRequest message from the specified reader or buffer. + * Decodes a PromoteClusterRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @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.CreateClusterRequest} CreateClusterRequest + * @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 */ - CreateClusterRequest.decode = function decode(reader, length) { + PromoteClusterRequest.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.name = reader.string(); break; } case 2: { - message.clusterId = reader.string(); + message.requestId = reader.string(); break; } case 3: { - message.cluster = $root.google.cloud.alloydb.v1.Cluster.decode(reader, reader.uint32()); + message.etag = reader.string(); break; } case 4: { - message.requestId = reader.string(); - break; - } - case 5: { message.validateOnly = reader.bool(); break; } @@ -12787,46 +17761,41 @@ }; /** - * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a PromoteClusterRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.CreateClusterRequest} CreateClusterRequest + * @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 */ - CreateClusterRequest.decodeDelimited = function decodeDelimited(reader) { + PromoteClusterRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateClusterRequest message. + * Verifies a PromoteClusterRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @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 */ - CreateClusterRequest.verify = function verify(message) { + PromoteClusterRequest.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.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"; @@ -12834,117 +17803,111 @@ }; /** - * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PromoteClusterRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.CreateClusterRequest} CreateClusterRequest + * @returns {google.cloud.alloydb.v1.PromoteClusterRequest} PromoteClusterRequest */ - CreateClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.CreateClusterRequest) + PromoteClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.PromoteClusterRequest) 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); - } + 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 CreateClusterRequest message. Also converts values to other types if specified. + * Creates a plain object from a PromoteClusterRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest * @static - * @param {google.cloud.alloydb.v1.CreateClusterRequest} message CreateClusterRequest + * @param {google.cloud.alloydb.v1.PromoteClusterRequest} message PromoteClusterRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateClusterRequest.toObject = function toObject(message, options) { + PromoteClusterRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.clusterId = ""; - object.cluster = null; + object.name = ""; object.requestId = ""; + object.etag = ""; 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.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 CreateClusterRequest to JSON. + * Converts this PromoteClusterRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest * @instance * @returns {Object.} JSON object */ - CreateClusterRequest.prototype.toJSON = function toJSON() { + PromoteClusterRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateClusterRequest + * Gets the default type url for PromoteClusterRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.CreateClusterRequest + * @memberof google.cloud.alloydb.v1.PromoteClusterRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PromoteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateClusterRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.PromoteClusterRequest"; }; - return CreateClusterRequest; + return PromoteClusterRequest; })(); - v1.UpdateClusterRequest = (function() { + v1.RestoreClusterRequest = (function() { /** - * Properties of an UpdateClusterRequest. + * Properties of a RestoreClusterRequest. * @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 + * @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 UpdateClusterRequest. + * Constructs a new RestoreClusterRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an UpdateClusterRequest. - * @implements IUpdateClusterRequest + * @classdesc Represents a RestoreClusterRequest. + * @implements IRestoreClusterRequest * @constructor - * @param {google.cloud.alloydb.v1.IUpdateClusterRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IRestoreClusterRequest=} [properties] Properties to set */ - function UpdateClusterRequest(properties) { + function RestoreClusterRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12952,131 +17915,173 @@ } /** - * UpdateClusterRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * RestoreClusterRequest backupSource. + * @member {google.cloud.alloydb.v1.IBackupSource|null|undefined} backupSource + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest * @instance */ - UpdateClusterRequest.prototype.updateMask = null; + RestoreClusterRequest.prototype.backupSource = null; /** - * UpdateClusterRequest cluster. + * 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.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest * @instance */ - UpdateClusterRequest.prototype.cluster = null; + RestoreClusterRequest.prototype.cluster = null; /** - * UpdateClusterRequest requestId. + * RestoreClusterRequest requestId. * @member {string} requestId - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest * @instance */ - UpdateClusterRequest.prototype.requestId = ""; + RestoreClusterRequest.prototype.requestId = ""; /** - * UpdateClusterRequest validateOnly. + * RestoreClusterRequest validateOnly. * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest * @instance */ - UpdateClusterRequest.prototype.validateOnly = false; + RestoreClusterRequest.prototype.validateOnly = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * UpdateClusterRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * RestoreClusterRequest source. + * @member {"backupSource"|"continuousBackupSource"|undefined} source + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest * @instance */ - UpdateClusterRequest.prototype.allowMissing = false; + Object.defineProperty(RestoreClusterRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["backupSource", "continuousBackupSource"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new UpdateClusterRequest instance using the specified properties. + * Creates a new RestoreClusterRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest * @static - * @param {google.cloud.alloydb.v1.IUpdateClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.UpdateClusterRequest} UpdateClusterRequest instance + * @param {google.cloud.alloydb.v1.IRestoreClusterRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.RestoreClusterRequest} RestoreClusterRequest instance */ - UpdateClusterRequest.create = function create(properties) { - return new UpdateClusterRequest(properties); + RestoreClusterRequest.create = function create(properties) { + return new RestoreClusterRequest(properties); }; /** - * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateClusterRequest.verify|verify} messages. + * Encodes the specified RestoreClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.RestoreClusterRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest * @static - * @param {google.cloud.alloydb.v1.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode + * @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 */ - UpdateClusterRequest.encode = function encode(message, writer) { + RestoreClusterRequest.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.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 2, wireType 2 =*/18).fork()).ldelim(); + $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 3, wireType 2 =*/26).string(message.requestId); + writer.uint32(/* id 5, wireType 2 =*/42).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); + 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 UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.UpdateClusterRequest.verify|verify} messages. + * 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.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest * @static - * @param {google.cloud.alloydb.v1.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode + * @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 */ - UpdateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + RestoreClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer. + * Decodes a RestoreClusterRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @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.UpdateClusterRequest} UpdateClusterRequest + * @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 */ - UpdateClusterRequest.decode = function decode(reader, length) { + RestoreClusterRequest.decode = function decode(reader, length) { 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(); + 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(); 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.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.parent = reader.string(); break; } case 2: { - message.cluster = $root.google.cloud.alloydb.v1.Cluster.decode(reader, reader.uint32()); + message.clusterId = reader.string(); break; } case 3: { - message.requestId = reader.string(); + message.cluster = $root.google.cloud.alloydb.v1.Cluster.decode(reader, reader.uint32()); break; } - case 4: { - message.validateOnly = reader.bool(); + case 5: { + message.requestId = reader.string(); break; } - case 5: { - message.allowMissing = reader.bool(); + case 6: { + message.validateOnly = reader.bool(); break; } default: @@ -13088,37 +18093,57 @@ }; /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a RestoreClusterRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.UpdateClusterRequest} UpdateClusterRequest + * @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 */ - UpdateClusterRequest.decodeDelimited = function decodeDelimited(reader) { + RestoreClusterRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateClusterRequest message. + * Verifies a RestoreClusterRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @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 */ - UpdateClusterRequest.verify = function verify(message) { + RestoreClusterRequest.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; + 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) @@ -13130,127 +18155,141 @@ 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. + * Creates a RestoreClusterRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.UpdateClusterRequest} UpdateClusterRequest + * @returns {google.cloud.alloydb.v1.RestoreClusterRequest} RestoreClusterRequest */ - UpdateClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.UpdateClusterRequest) + RestoreClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.RestoreClusterRequest) 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); + 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.UpdateClusterRequest.cluster: object expected"); + 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); - 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. + * Creates a plain object from a RestoreClusterRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest * @static - * @param {google.cloud.alloydb.v1.UpdateClusterRequest} message UpdateClusterRequest + * @param {google.cloud.alloydb.v1.RestoreClusterRequest} message RestoreClusterRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateClusterRequest.toObject = function toObject(message, options) { + RestoreClusterRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.updateMask = null; + object.parent = ""; + object.clusterId = ""; 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.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.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; + 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 UpdateClusterRequest to JSON. + * Converts this RestoreClusterRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest * @instance * @returns {Object.} JSON object */ - UpdateClusterRequest.prototype.toJSON = function toJSON() { + RestoreClusterRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateClusterRequest + * Gets the default type url for RestoreClusterRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.UpdateClusterRequest + * @memberof google.cloud.alloydb.v1.RestoreClusterRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RestoreClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.UpdateClusterRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.RestoreClusterRequest"; }; - return UpdateClusterRequest; + return RestoreClusterRequest; })(); - v1.DeleteClusterRequest = (function() { + v1.ListInstancesRequest = (function() { /** - * Properties of a DeleteClusterRequest. + * Properties of a ListInstancesRequest. * @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 + * @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 DeleteClusterRequest. + * Constructs a new ListInstancesRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a DeleteClusterRequest. - * @implements IDeleteClusterRequest + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest * @constructor - * @param {google.cloud.alloydb.v1.IDeleteClusterRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IListInstancesRequest=} [properties] Properties to set */ - function DeleteClusterRequest(properties) { + function ListInstancesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13258,131 +18297,131 @@ } /** - * DeleteClusterRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * ListInstancesRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @instance */ - DeleteClusterRequest.prototype.name = ""; + ListInstancesRequest.prototype.parent = ""; /** - * DeleteClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * ListInstancesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @instance */ - DeleteClusterRequest.prototype.requestId = ""; + ListInstancesRequest.prototype.pageSize = 0; /** - * DeleteClusterRequest etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @instance */ - DeleteClusterRequest.prototype.etag = ""; + ListInstancesRequest.prototype.pageToken = ""; /** - * DeleteClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * ListInstancesRequest filter. + * @member {string} filter + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @instance */ - DeleteClusterRequest.prototype.validateOnly = false; + ListInstancesRequest.prototype.filter = ""; /** - * DeleteClusterRequest force. - * @member {boolean} force - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * ListInstancesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @instance */ - DeleteClusterRequest.prototype.force = false; + ListInstancesRequest.prototype.orderBy = ""; /** - * Creates a new DeleteClusterRequest instance using the specified properties. + * Creates a new ListInstancesRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @static - * @param {google.cloud.alloydb.v1.IDeleteClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.DeleteClusterRequest} DeleteClusterRequest instance + * @param {google.cloud.alloydb.v1.IListInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ListInstancesRequest} ListInstancesRequest instance */ - DeleteClusterRequest.create = function create(properties) { - return new DeleteClusterRequest(properties); + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); }; /** - * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteClusterRequest.verify|verify} messages. + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @static - * @param {google.cloud.alloydb.v1.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @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 */ - DeleteClusterRequest.encode = function encode(message, writer) { + ListInstancesRequest.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); + 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 DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.DeleteClusterRequest.verify|verify} messages. + * 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.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @static - * @param {google.cloud.alloydb.v1.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @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 */ - DeleteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * Decodes a ListInstancesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @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.DeleteClusterRequest} DeleteClusterRequest + * @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 */ - DeleteClusterRequest.decode = function decode(reader, length) { + ListInstancesRequest.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.parent = reader.string(); break; } case 2: { - message.requestId = reader.string(); + message.pageSize = reader.int32(); break; } case 3: { - message.etag = reader.string(); + message.pageToken = reader.string(); break; } case 4: { - message.validateOnly = reader.bool(); + message.filter = reader.string(); break; } case 5: { - message.force = reader.bool(); + message.orderBy = reader.string(); break; } default: @@ -13394,158 +18433,159 @@ }; /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.DeleteClusterRequest} DeleteClusterRequest + * @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 */ - DeleteClusterRequest.decodeDelimited = function decodeDelimited(reader) { + ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteClusterRequest message. + * Verifies a ListInstancesRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @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 */ - DeleteClusterRequest.verify = function verify(message) { + ListInstancesRequest.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"; + 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 DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.DeleteClusterRequest} DeleteClusterRequest + * @returns {google.cloud.alloydb.v1.ListInstancesRequest} ListInstancesRequest */ - DeleteClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.DeleteClusterRequest) + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ListInstancesRequest) 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); + 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 DeleteClusterRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @static - * @param {google.cloud.alloydb.v1.DeleteClusterRequest} message DeleteClusterRequest + * @param {google.cloud.alloydb.v1.ListInstancesRequest} message ListInstancesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteClusterRequest.toObject = function toObject(message, options) { + ListInstancesRequest.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; + 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 DeleteClusterRequest to JSON. + * Converts this ListInstancesRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @instance * @returns {Object.} JSON object */ - DeleteClusterRequest.prototype.toJSON = function toJSON() { + ListInstancesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteClusterRequest + * Gets the default type url for ListInstancesRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.DeleteClusterRequest + * @memberof google.cloud.alloydb.v1.ListInstancesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.DeleteClusterRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.ListInstancesRequest"; }; - return DeleteClusterRequest; + return ListInstancesRequest; })(); - v1.PromoteClusterRequest = (function() { + v1.ListInstancesResponse = (function() { /** - * Properties of a PromoteClusterRequest. + * Properties of a ListInstancesResponse. * @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 + * @interface IListInstancesResponse + * @property {Array.|null} [instances] ListInstancesResponse instances + * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken + * @property {Array.|null} [unreachable] ListInstancesResponse unreachable */ /** - * Constructs a new PromoteClusterRequest. + * Constructs a new ListInstancesResponse. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a PromoteClusterRequest. - * @implements IPromoteClusterRequest + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse * @constructor - * @param {google.cloud.alloydb.v1.IPromoteClusterRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IListInstancesResponse=} [properties] Properties to set */ - function PromoteClusterRequest(properties) { + 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) @@ -13553,117 +18593,109 @@ } /** - * 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 + * ListInstancesResponse instances. + * @member {Array.} instances + * @memberof google.cloud.alloydb.v1.ListInstancesResponse * @instance */ - PromoteClusterRequest.prototype.requestId = ""; + ListInstancesResponse.prototype.instances = $util.emptyArray; /** - * PromoteClusterRequest etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1.PromoteClusterRequest + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.alloydb.v1.ListInstancesResponse * @instance */ - PromoteClusterRequest.prototype.etag = ""; + ListInstancesResponse.prototype.nextPageToken = ""; /** - * PromoteClusterRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.PromoteClusterRequest + * ListInstancesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.alloydb.v1.ListInstancesResponse * @instance */ - PromoteClusterRequest.prototype.validateOnly = false; + ListInstancesResponse.prototype.unreachable = $util.emptyArray; /** - * Creates a new PromoteClusterRequest instance using the specified properties. + * Creates a new ListInstancesResponse instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1.ListInstancesResponse * @static - * @param {google.cloud.alloydb.v1.IPromoteClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.PromoteClusterRequest} PromoteClusterRequest instance + * @param {google.cloud.alloydb.v1.IListInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ListInstancesResponse} ListInstancesResponse instance */ - PromoteClusterRequest.create = function create(properties) { - return new PromoteClusterRequest(properties); + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); }; /** - * Encodes the specified PromoteClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.PromoteClusterRequest.verify|verify} messages. + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1.ListInstancesResponse * @static - * @param {google.cloud.alloydb.v1.IPromoteClusterRequest} message PromoteClusterRequest message or plain object to encode + * @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 */ - PromoteClusterRequest.encode = function encode(message, writer) { + ListInstancesResponse.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.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 PromoteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.PromoteClusterRequest.verify|verify} messages. + * 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.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1.ListInstancesResponse * @static - * @param {google.cloud.alloydb.v1.IPromoteClusterRequest} message PromoteClusterRequest message or plain object to encode + * @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 */ - PromoteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PromoteClusterRequest message from the specified reader or buffer. + * Decodes a ListInstancesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.PromoteClusterRequest + * @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.PromoteClusterRequest} PromoteClusterRequest + * @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 */ - PromoteClusterRequest.decode = function decode(reader, length) { + ListInstancesResponse.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + 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.requestId = reader.string(); + message.nextPageToken = reader.string(); break; } case 3: { - message.etag = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); break; } default: @@ -13675,153 +18707,170 @@ }; /** - * Decodes a PromoteClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1.ListInstancesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.PromoteClusterRequest} PromoteClusterRequest + * @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 */ - PromoteClusterRequest.decodeDelimited = function decodeDelimited(reader) { + ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PromoteClusterRequest message. + * Verifies a ListInstancesResponse message. * @function verify - * @memberof google.cloud.alloydb.v1.PromoteClusterRequest + * @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 */ - PromoteClusterRequest.verify = function verify(message) { + ListInstancesResponse.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.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 PromoteClusterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1.ListInstancesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.PromoteClusterRequest} PromoteClusterRequest + * @returns {google.cloud.alloydb.v1.ListInstancesResponse} ListInstancesResponse */ - PromoteClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.PromoteClusterRequest) + ListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ListInstancesResponse) 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); + 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 PromoteClusterRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1.ListInstancesResponse * @static - * @param {google.cloud.alloydb.v1.PromoteClusterRequest} message PromoteClusterRequest + * @param {google.cloud.alloydb.v1.ListInstancesResponse} message ListInstancesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PromoteClusterRequest.toObject = function toObject(message, options) { + ListInstancesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.etag = ""; - object.validateOnly = false; + 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]; } - 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. + * Converts this ListInstancesResponse to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1.ListInstancesResponse * @instance * @returns {Object.} JSON object */ - PromoteClusterRequest.prototype.toJSON = function toJSON() { + ListInstancesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PromoteClusterRequest + * Gets the default type url for ListInstancesResponse * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.PromoteClusterRequest + * @memberof google.cloud.alloydb.v1.ListInstancesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PromoteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.PromoteClusterRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.ListInstancesResponse"; }; - return PromoteClusterRequest; + return ListInstancesResponse; })(); - v1.RestoreClusterRequest = (function() { + v1.GetInstanceRequest = (function() { /** - * Properties of a RestoreClusterRequest. + * Properties of a GetInstanceRequest. * @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 + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + * @property {google.cloud.alloydb.v1.InstanceView|null} [view] GetInstanceRequest view */ /** - * Constructs a new RestoreClusterRequest. + * Constructs a new GetInstanceRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a RestoreClusterRequest. - * @implements IRestoreClusterRequest + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1.IRestoreClusterRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IGetInstanceRequest=} [properties] Properties to set */ - function RestoreClusterRequest(properties) { + function GetInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13829,173 +18878,89 @@ } /** - * 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 + * GetInstanceRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.GetInstanceRequest * @instance */ - RestoreClusterRequest.prototype.validateOnly = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + GetInstanceRequest.prototype.name = ""; /** - * RestoreClusterRequest source. - * @member {"backupSource"|"continuousBackupSource"|undefined} source - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * GetInstanceRequest view. + * @member {google.cloud.alloydb.v1.InstanceView} view + * @memberof google.cloud.alloydb.v1.GetInstanceRequest * @instance */ - Object.defineProperty(RestoreClusterRequest.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["backupSource", "continuousBackupSource"]), - set: $util.oneOfSetter($oneOfFields) - }); + GetInstanceRequest.prototype.view = 0; /** - * Creates a new RestoreClusterRequest instance using the specified properties. + * Creates a new GetInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1.GetInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IRestoreClusterRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.RestoreClusterRequest} RestoreClusterRequest instance + * @param {google.cloud.alloydb.v1.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.GetInstanceRequest} GetInstanceRequest instance */ - RestoreClusterRequest.create = function create(properties) { - return new RestoreClusterRequest(properties); + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); }; /** - * Encodes the specified RestoreClusterRequest message. Does not implicitly {@link google.cloud.alloydb.v1.RestoreClusterRequest.verify|verify} messages. + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1.GetInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IRestoreClusterRequest} message RestoreClusterRequest message or plain object to encode + * @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 */ - RestoreClusterRequest.encode = function encode(message, writer) { + GetInstanceRequest.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(); + 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 RestoreClusterRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.RestoreClusterRequest.verify|verify} messages. + * 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.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1.GetInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IRestoreClusterRequest} message RestoreClusterRequest message or plain object to encode + * @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 */ - RestoreClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RestoreClusterRequest message from the specified reader or buffer. + * Decodes a GetInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @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.RestoreClusterRequest} RestoreClusterRequest + * @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 */ - RestoreClusterRequest.decode = function decode(reader, length) { + GetInstanceRequest.decode = function decode(reader, length) { 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(); + 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(); 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(); + message.name = 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(); + message.view = reader.int32(); break; } default: @@ -14007,203 +18972,159 @@ }; /** - * Decodes a RestoreClusterRequest message from the specified reader or buffer, length delimited. + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1.GetInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.RestoreClusterRequest} RestoreClusterRequest + * @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 */ - RestoreClusterRequest.decodeDelimited = function decodeDelimited(reader) { + GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RestoreClusterRequest message. + * Verifies a GetInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @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 */ - RestoreClusterRequest.verify = function verify(message) { + GetInstanceRequest.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.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; } - } - 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. + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1.GetInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.RestoreClusterRequest} RestoreClusterRequest + * @returns {google.cloud.alloydb.v1.GetInstanceRequest} GetInstanceRequest */ - RestoreClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.RestoreClusterRequest) + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.GetInstanceRequest) 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); + 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; } - 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. + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1.GetInstanceRequest * @static - * @param {google.cloud.alloydb.v1.RestoreClusterRequest} message RestoreClusterRequest + * @param {google.cloud.alloydb.v1.GetInstanceRequest} message GetInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RestoreClusterRequest.toObject = function toObject(message, options) { + GetInstanceRequest.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"; + 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 RestoreClusterRequest to JSON. + * Converts this GetInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1.GetInstanceRequest * @instance * @returns {Object.} JSON object */ - RestoreClusterRequest.prototype.toJSON = function toJSON() { + GetInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RestoreClusterRequest + * Gets the default type url for GetInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.RestoreClusterRequest + * @memberof google.cloud.alloydb.v1.GetInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RestoreClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.RestoreClusterRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.GetInstanceRequest"; }; - return RestoreClusterRequest; + return GetInstanceRequest; })(); - v1.ListInstancesRequest = (function() { + v1.CreateInstanceRequest = (function() { /** - * Properties of a ListInstancesRequest. + * Properties of a CreateInstanceRequest. * @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 + * @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 ListInstancesRequest. + * Constructs a new CreateInstanceRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ListInstancesRequest. - * @implements IListInstancesRequest + * @classdesc Represents a CreateInstanceRequest. + * @implements ICreateInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1.IListInstancesRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.ICreateInstanceRequest=} [properties] Properties to set */ - function ListInstancesRequest(properties) { + function CreateInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14211,110 +19132,110 @@ } /** - * ListInstancesRequest parent. + * CreateInstanceRequest parent. * @member {string} parent - * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest * @instance */ - ListInstancesRequest.prototype.parent = ""; + CreateInstanceRequest.prototype.parent = ""; /** - * ListInstancesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * CreateInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest * @instance */ - ListInstancesRequest.prototype.pageSize = 0; + CreateInstanceRequest.prototype.instanceId = ""; /** - * ListInstancesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * CreateInstanceRequest instance. + * @member {google.cloud.alloydb.v1.IInstance|null|undefined} instance + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest * @instance */ - ListInstancesRequest.prototype.pageToken = ""; + CreateInstanceRequest.prototype.instance = null; /** - * ListInstancesRequest filter. - * @member {string} filter - * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * CreateInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest * @instance */ - ListInstancesRequest.prototype.filter = ""; + CreateInstanceRequest.prototype.requestId = ""; /** - * ListInstancesRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * CreateInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest * @instance */ - ListInstancesRequest.prototype.orderBy = ""; + CreateInstanceRequest.prototype.validateOnly = false; /** - * Creates a new ListInstancesRequest instance using the specified properties. + * Creates a new CreateInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IListInstancesRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ListInstancesRequest} ListInstancesRequest instance + * @param {google.cloud.alloydb.v1.ICreateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.CreateInstanceRequest} CreateInstanceRequest instance */ - ListInstancesRequest.create = function create(properties) { - return new ListInstancesRequest(properties); + CreateInstanceRequest.create = function create(properties) { + return new CreateInstanceRequest(properties); }; /** - * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesRequest.verify|verify} messages. + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @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 */ - ListInstancesRequest.encode = function encode(message, 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.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); + 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 ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesRequest.verify|verify} messages. + * 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.ListInstancesRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @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 */ - ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListInstancesRequest message from the specified reader or buffer. + * Decodes a CreateInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @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.ListInstancesRequest} ListInstancesRequest + * @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 */ - ListInstancesRequest.decode = function decode(reader, length) { + CreateInstanceRequest.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { @@ -14323,19 +19244,19 @@ break; } case 2: { - message.pageSize = reader.int32(); + message.instanceId = reader.string(); break; } case 3: { - message.pageToken = reader.string(); + message.instance = $root.google.cloud.alloydb.v1.Instance.decode(reader, reader.uint32()); break; } case 4: { - message.filter = reader.string(); + message.requestId = reader.string(); break; } case 5: { - message.orderBy = reader.string(); + message.validateOnly = reader.bool(); break; } default: @@ -14347,159 +19268,164 @@ }; /** - * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ListInstancesRequest} ListInstancesRequest + * @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 */ - ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListInstancesRequest message. + * Verifies a CreateInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @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 */ - ListInstancesRequest.verify = function verify(message) { + 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.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"; + 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 ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ListInstancesRequest} ListInstancesRequest + * @returns {google.cloud.alloydb.v1.CreateInstanceRequest} CreateInstanceRequest */ - ListInstancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ListInstancesRequest) + CreateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.CreateInstanceRequest) return object; - var message = new $root.google.cloud.alloydb.v1.ListInstancesRequest(); + var message = new $root.google.cloud.alloydb.v1.CreateInstanceRequest(); 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); + 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 ListInstancesRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest * @static - * @param {google.cloud.alloydb.v1.ListInstancesRequest} message ListInstancesRequest + * @param {google.cloud.alloydb.v1.CreateInstanceRequest} message CreateInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListInstancesRequest.toObject = function toObject(message, options) { + CreateInstanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; + object.instanceId = ""; + object.instance = null; + object.requestId = ""; + object.validateOnly = false; } 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; + 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 ListInstancesRequest to JSON. + * Converts this CreateInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest * @instance * @returns {Object.} JSON object */ - ListInstancesRequest.prototype.toJSON = function toJSON() { + CreateInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListInstancesRequest + * Gets the default type url for CreateInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ListInstancesRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ListInstancesRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateInstanceRequest"; }; - return ListInstancesRequest; + return CreateInstanceRequest; })(); - v1.ListInstancesResponse = (function() { + v1.CreateSecondaryInstanceRequest = (function() { /** - * Properties of a ListInstancesResponse. + * Properties of a CreateSecondaryInstanceRequest. * @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 + * @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 ListInstancesResponse. + * Constructs a new CreateSecondaryInstanceRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a ListInstancesResponse. - * @implements IListInstancesResponse + * @classdesc Represents a CreateSecondaryInstanceRequest. + * @implements ICreateSecondaryInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1.IListInstancesResponse=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest=} [properties] Properties to set */ - function ListInstancesResponse(properties) { - this.instances = []; - this.unreachable = []; + function CreateSecondaryInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14507,109 +19433,131 @@ } /** - * ListInstancesResponse instances. - * @member {Array.} instances - * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * CreateSecondaryInstanceRequest parent. + * @member {string} parent + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest * @instance */ - ListInstancesResponse.prototype.instances = $util.emptyArray; + CreateSecondaryInstanceRequest.prototype.parent = ""; /** - * ListInstancesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * CreateSecondaryInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest * @instance */ - ListInstancesResponse.prototype.nextPageToken = ""; + CreateSecondaryInstanceRequest.prototype.instanceId = ""; /** - * ListInstancesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * CreateSecondaryInstanceRequest instance. + * @member {google.cloud.alloydb.v1.IInstance|null|undefined} instance + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest * @instance */ - ListInstancesResponse.prototype.unreachable = $util.emptyArray; + CreateSecondaryInstanceRequest.prototype.instance = null; /** - * Creates a new ListInstancesResponse instance using the specified properties. + * 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.ListInstancesResponse + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IListInstancesResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.ListInstancesResponse} ListInstancesResponse instance + * @param {google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest instance */ - ListInstancesResponse.create = function create(properties) { - return new ListInstancesResponse(properties); + CreateSecondaryInstanceRequest.create = function create(properties) { + return new CreateSecondaryInstanceRequest(properties); }; /** - * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesResponse.verify|verify} messages. + * Encodes the specified CreateSecondaryInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @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 */ - ListInstancesResponse.encode = function encode(message, writer) { + CreateSecondaryInstanceRequest.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]); + 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 ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.ListInstancesResponse.verify|verify} messages. + * 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.ListInstancesResponse + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @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 */ - ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + CreateSecondaryInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListInstancesResponse message from the specified reader or buffer. + * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @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.ListInstancesResponse} ListInstancesResponse + * @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 */ - ListInstancesResponse.decode = function decode(reader, length) { + CreateSecondaryInstanceRequest.decode = function decode(reader, length) { 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(); + 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(); 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())); + message.parent = reader.string(); break; } case 2: { - message.nextPageToken = reader.string(); + message.instanceId = reader.string(); break; } case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); + 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: @@ -14621,170 +19569,161 @@ }; /** - * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.ListInstancesResponse} ListInstancesResponse + * @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 */ - ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + CreateSecondaryInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListInstancesResponse message. + * Verifies a CreateSecondaryInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @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 */ - ListInstancesResponse.verify = function verify(message) { + CreateSecondaryInstanceRequest.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"; + 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 ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSecondaryInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.ListInstancesResponse} ListInstancesResponse + * @returns {google.cloud.alloydb.v1.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest */ - ListInstancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.ListInstancesResponse) + CreateSecondaryInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest) 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]); + 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 ListInstancesResponse message. Also converts values to other types if specified. + * Creates a plain object from a CreateSecondaryInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest * @static - * @param {google.cloud.alloydb.v1.ListInstancesResponse} message ListInstancesResponse + * @param {google.cloud.alloydb.v1.CreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListInstancesResponse.toObject = function toObject(message, options) { + CreateSecondaryInstanceRequest.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]; + 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 ListInstancesResponse to JSON. + * Converts this CreateSecondaryInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest * @instance * @returns {Object.} JSON object */ - ListInstancesResponse.prototype.toJSON = function toJSON() { + CreateSecondaryInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListInstancesResponse + * Gets the default type url for CreateSecondaryInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.ListInstancesResponse + * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateSecondaryInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.ListInstancesResponse"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateSecondaryInstanceRequest"; }; - return ListInstancesResponse; + return CreateSecondaryInstanceRequest; })(); - v1.GetInstanceRequest = (function() { + v1.CreateInstanceRequests = (function() { /** - * Properties of a GetInstanceRequest. + * Properties of a CreateInstanceRequests. * @memberof google.cloud.alloydb.v1 - * @interface IGetInstanceRequest - * @property {string|null} [name] GetInstanceRequest name - * @property {google.cloud.alloydb.v1.InstanceView|null} [view] GetInstanceRequest view + * @interface ICreateInstanceRequests + * @property {Array.|null} [createInstanceRequests] CreateInstanceRequests createInstanceRequests */ /** - * Constructs a new GetInstanceRequest. + * Constructs a new CreateInstanceRequests. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a GetInstanceRequest. - * @implements IGetInstanceRequest + * @classdesc Represents a CreateInstanceRequests. + * @implements ICreateInstanceRequests * @constructor - * @param {google.cloud.alloydb.v1.IGetInstanceRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.ICreateInstanceRequests=} [properties] Properties to set */ - function GetInstanceRequest(properties) { + function CreateInstanceRequests(properties) { + this.createInstanceRequests = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14792,89 +19731,78 @@ } /** - * 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 + * CreateInstanceRequests createInstanceRequests. + * @member {Array.} createInstanceRequests + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests * @instance */ - GetInstanceRequest.prototype.view = 0; + CreateInstanceRequests.prototype.createInstanceRequests = $util.emptyArray; /** - * Creates a new GetInstanceRequest instance using the specified properties. + * Creates a new CreateInstanceRequests instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests * @static - * @param {google.cloud.alloydb.v1.IGetInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.GetInstanceRequest} GetInstanceRequest instance + * @param {google.cloud.alloydb.v1.ICreateInstanceRequests=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.CreateInstanceRequests} CreateInstanceRequests instance */ - GetInstanceRequest.create = function create(properties) { - return new GetInstanceRequest(properties); + CreateInstanceRequests.create = function create(properties) { + return new CreateInstanceRequests(properties); }; /** - * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.GetInstanceRequest.verify|verify} messages. + * Encodes the specified CreateInstanceRequests message. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequests.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests * @static - * @param {google.cloud.alloydb.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @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 */ - GetInstanceRequest.encode = function encode(message, writer) { + CreateInstanceRequests.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); + 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 GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.GetInstanceRequest.verify|verify} messages. + * 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.GetInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests * @static - * @param {google.cloud.alloydb.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @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 */ - GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateInstanceRequests.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetInstanceRequest message from the specified reader or buffer. + * Decodes a CreateInstanceRequests message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @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.GetInstanceRequest} GetInstanceRequest + * @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 */ - GetInstanceRequest.decode = function decode(reader, length) { + CreateInstanceRequests.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.view = reader.int32(); + if (!(message.createInstanceRequests && message.createInstanceRequests.length)) + message.createInstanceRequests = []; + message.createInstanceRequests.push($root.google.cloud.alloydb.v1.CreateInstanceRequest.decode(reader, reader.uint32())); break; } default: @@ -14886,159 +19814,141 @@ }; /** - * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateInstanceRequests message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.GetInstanceRequest} GetInstanceRequest + * @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 */ - GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + CreateInstanceRequests.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetInstanceRequest message. + * Verifies a CreateInstanceRequests message. * @function verify - * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @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 */ - GetInstanceRequest.verify = function verify(message) { + CreateInstanceRequests.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; + 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 GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateInstanceRequests message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.GetInstanceRequest} GetInstanceRequest + * @returns {google.cloud.alloydb.v1.CreateInstanceRequests} CreateInstanceRequests */ - GetInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.GetInstanceRequest) + CreateInstanceRequests.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.CreateInstanceRequests) 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; + 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]); } - 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. + * Creates a plain object from a CreateInstanceRequests message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests * @static - * @param {google.cloud.alloydb.v1.GetInstanceRequest} message GetInstanceRequest + * @param {google.cloud.alloydb.v1.CreateInstanceRequests} message CreateInstanceRequests * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetInstanceRequest.toObject = function toObject(message, options) { + CreateInstanceRequests.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 (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); } - 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. + * Converts this CreateInstanceRequests to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests * @instance * @returns {Object.} JSON object */ - GetInstanceRequest.prototype.toJSON = function toJSON() { + CreateInstanceRequests.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetInstanceRequest + * Gets the default type url for CreateInstanceRequests * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.GetInstanceRequest + * @memberof google.cloud.alloydb.v1.CreateInstanceRequests * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateInstanceRequests.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.GetInstanceRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateInstanceRequests"; }; - return GetInstanceRequest; + return CreateInstanceRequests; })(); - v1.CreateInstanceRequest = (function() { + v1.BatchCreateInstancesRequest = (function() { /** - * Properties of a CreateInstanceRequest. + * Properties of a BatchCreateInstancesRequest. * @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 + * @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 CreateInstanceRequest. + * Constructs a new BatchCreateInstancesRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a CreateInstanceRequest. - * @implements ICreateInstanceRequest + * @classdesc Represents a BatchCreateInstancesRequest. + * @implements IBatchCreateInstancesRequest * @constructor - * @param {google.cloud.alloydb.v1.ICreateInstanceRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest=} [properties] Properties to set */ - function CreateInstanceRequest(properties) { + function BatchCreateInstancesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15046,110 +19956,90 @@ } /** - * CreateInstanceRequest parent. + * BatchCreateInstancesRequest 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 + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest * @instance */ - CreateInstanceRequest.prototype.instanceId = ""; + BatchCreateInstancesRequest.prototype.parent = ""; /** - * CreateInstanceRequest instance. - * @member {google.cloud.alloydb.v1.IInstance|null|undefined} instance - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * BatchCreateInstancesRequest requests. + * @member {google.cloud.alloydb.v1.ICreateInstanceRequests|null|undefined} requests + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest * @instance */ - CreateInstanceRequest.prototype.instance = null; + BatchCreateInstancesRequest.prototype.requests = null; /** - * CreateInstanceRequest requestId. + * BatchCreateInstancesRequest 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 + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest * @instance */ - CreateInstanceRequest.prototype.validateOnly = false; + BatchCreateInstancesRequest.prototype.requestId = ""; /** - * Creates a new CreateInstanceRequest instance using the specified properties. + * Creates a new BatchCreateInstancesRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest * @static - * @param {google.cloud.alloydb.v1.ICreateInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.CreateInstanceRequest} CreateInstanceRequest instance + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesRequest} BatchCreateInstancesRequest instance */ - CreateInstanceRequest.create = function create(properties) { - return new CreateInstanceRequest(properties); + BatchCreateInstancesRequest.create = function create(properties) { + return new BatchCreateInstancesRequest(properties); }; /** - * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequest.verify|verify} messages. + * Encodes the specified BatchCreateInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest * @static - * @param {google.cloud.alloydb.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @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 */ - CreateInstanceRequest.encode = function encode(message, 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.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.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 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); + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); return writer; }; /** - * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequest.verify|verify} messages. + * 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.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest * @static - * @param {google.cloud.alloydb.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @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 */ - CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + BatchCreateInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @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.CreateInstanceRequest} CreateInstanceRequest + * @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 */ - CreateInstanceRequest.decode = function decode(reader, length) { + BatchCreateInstancesRequest.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { @@ -15158,21 +20048,13 @@ break; } case 2: { - message.instanceId = reader.string(); + message.requests = $root.google.cloud.alloydb.v1.CreateInstanceRequests.decode(reader, reader.uint32()); 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; @@ -15182,164 +20064,145 @@ }; /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.CreateInstanceRequest} CreateInstanceRequest + * @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 */ - CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + BatchCreateInstancesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateInstanceRequest message. + * Verifies a BatchCreateInstancesRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @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 */ - CreateInstanceRequest.verify = function verify(message) { + 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.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 (message.requests != null && message.hasOwnProperty("requests")) { + var error = $root.google.cloud.alloydb.v1.CreateInstanceRequests.verify(message.requests); if (error) - return "instance." + error; + return "requests." + 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. + * Creates a BatchCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.CreateInstanceRequest} CreateInstanceRequest + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesRequest} BatchCreateInstancesRequest */ - CreateInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.CreateInstanceRequest) + BatchCreateInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.BatchCreateInstancesRequest) return object; - var message = new $root.google.cloud.alloydb.v1.CreateInstanceRequest(); + var message = new $root.google.cloud.alloydb.v1.BatchCreateInstancesRequest(); 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.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); - 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. + * Creates a plain object from a BatchCreateInstancesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest * @static - * @param {google.cloud.alloydb.v1.CreateInstanceRequest} message CreateInstanceRequest + * @param {google.cloud.alloydb.v1.BatchCreateInstancesRequest} message BatchCreateInstancesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateInstanceRequest.toObject = function toObject(message, options) { + BatchCreateInstancesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.instanceId = ""; - object.instance = null; + object.requests = 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.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; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; return object; }; /** - * Converts this CreateInstanceRequest to JSON. + * Converts this BatchCreateInstancesRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest * @instance * @returns {Object.} JSON object */ - CreateInstanceRequest.prototype.toJSON = function toJSON() { + BatchCreateInstancesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateInstanceRequest + * Gets the default type url for BatchCreateInstancesRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.CreateInstanceRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BatchCreateInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateInstanceRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.BatchCreateInstancesRequest"; }; - return CreateInstanceRequest; + return BatchCreateInstancesRequest; })(); - v1.CreateSecondaryInstanceRequest = (function() { + v1.BatchCreateInstancesResponse = (function() { /** - * Properties of a CreateSecondaryInstanceRequest. + * Properties of a BatchCreateInstancesResponse. * @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 + * @interface IBatchCreateInstancesResponse + * @property {Array.|null} [instances] BatchCreateInstancesResponse instances */ /** - * Constructs a new CreateSecondaryInstanceRequest. + * Constructs a new BatchCreateInstancesResponse. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a CreateSecondaryInstanceRequest. - * @implements ICreateSecondaryInstanceRequest + * @classdesc Represents a BatchCreateInstancesResponse. + * @implements IBatchCreateInstancesResponse * @constructor - * @param {google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesResponse=} [properties] Properties to set */ - function CreateSecondaryInstanceRequest(properties) { + function BatchCreateInstancesResponse(properties) { + this.instances = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15347,131 +20210,78 @@ } /** - * 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 + * BatchCreateInstancesResponse instances. + * @member {Array.} instances + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse * @instance */ - CreateSecondaryInstanceRequest.prototype.validateOnly = false; + BatchCreateInstancesResponse.prototype.instances = $util.emptyArray; /** - * Creates a new CreateSecondaryInstanceRequest instance using the specified properties. + * Creates a new BatchCreateInstancesResponse instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse * @static - * @param {google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest instance + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesResponse} BatchCreateInstancesResponse instance */ - CreateSecondaryInstanceRequest.create = function create(properties) { - return new CreateSecondaryInstanceRequest(properties); + BatchCreateInstancesResponse.create = function create(properties) { + return new BatchCreateInstancesResponse(properties); }; /** - * Encodes the specified CreateSecondaryInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryInstanceRequest.verify|verify} messages. + * Encodes the specified BatchCreateInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse * @static - * @param {google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest message or plain object to encode + * @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 */ - CreateSecondaryInstanceRequest.encode = function encode(message, writer) { + BatchCreateInstancesResponse.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); + 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 CreateSecondaryInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateSecondaryInstanceRequest.verify|verify} messages. + * 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.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse * @static - * @param {google.cloud.alloydb.v1.ICreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest message or plain object to encode + * @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 */ - CreateSecondaryInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + BatchCreateInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer. + * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest + * @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.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest + * @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 */ - CreateSecondaryInstanceRequest.decode = function decode(reader, length) { + BatchCreateInstancesResponse.decode = function decode(reader, length) { 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(); + 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(); 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(); + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.alloydb.v1.Instance.decode(reader, reader.uint32())); break; } default: @@ -15483,161 +20293,142 @@ }; /** - * Decodes a CreateSecondaryInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest + * @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 */ - CreateSecondaryInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + BatchCreateInstancesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateSecondaryInstanceRequest message. + * Verifies a BatchCreateInstancesResponse message. * @function verify - * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest + * @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 */ - CreateSecondaryInstanceRequest.verify = function verify(message) { + BatchCreateInstancesResponse.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.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.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. + * Creates a BatchCreateInstancesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.CreateSecondaryInstanceRequest} CreateSecondaryInstanceRequest + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesResponse} BatchCreateInstancesResponse */ - CreateSecondaryInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.CreateSecondaryInstanceRequest) + BatchCreateInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.BatchCreateInstancesResponse) 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); + 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]); + } } - 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. + * Creates a plain object from a BatchCreateInstancesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse * @static - * @param {google.cloud.alloydb.v1.CreateSecondaryInstanceRequest} message CreateSecondaryInstanceRequest + * @param {google.cloud.alloydb.v1.BatchCreateInstancesResponse} message BatchCreateInstancesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateSecondaryInstanceRequest.toObject = function toObject(message, options) { + BatchCreateInstancesResponse.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 (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); } - 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. + * Converts this BatchCreateInstancesResponse to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse * @instance * @returns {Object.} JSON object */ - CreateSecondaryInstanceRequest.prototype.toJSON = function toJSON() { + BatchCreateInstancesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateSecondaryInstanceRequest + * Gets the default type url for BatchCreateInstancesResponse * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.CreateSecondaryInstanceRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateSecondaryInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BatchCreateInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateSecondaryInstanceRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.BatchCreateInstancesResponse"; }; - return CreateSecondaryInstanceRequest; + return BatchCreateInstancesResponse; })(); - v1.CreateInstanceRequests = (function() { + v1.BatchCreateInstancesMetadata = (function() { /** - * Properties of a CreateInstanceRequests. + * Properties of a BatchCreateInstancesMetadata. * @memberof google.cloud.alloydb.v1 - * @interface ICreateInstanceRequests - * @property {Array.|null} [createInstanceRequests] CreateInstanceRequests createInstanceRequests + * @interface IBatchCreateInstancesMetadata + * @property {Array.|null} [instanceTargets] BatchCreateInstancesMetadata instanceTargets + * @property {Object.|null} [instanceStatuses] BatchCreateInstancesMetadata instanceStatuses */ /** - * Constructs a new CreateInstanceRequests. + * Constructs a new BatchCreateInstancesMetadata. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a CreateInstanceRequests. - * @implements ICreateInstanceRequests + * @classdesc Represents a BatchCreateInstancesMetadata. + * @implements IBatchCreateInstancesMetadata * @constructor - * @param {google.cloud.alloydb.v1.ICreateInstanceRequests=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata=} [properties] Properties to set */ - function CreateInstanceRequests(properties) { - this.createInstanceRequests = []; + 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) @@ -15645,78 +20436,114 @@ } /** - * CreateInstanceRequests createInstanceRequests. - * @member {Array.} createInstanceRequests - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * BatchCreateInstancesMetadata instanceTargets. + * @member {Array.} instanceTargets + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata * @instance */ - CreateInstanceRequests.prototype.createInstanceRequests = $util.emptyArray; + BatchCreateInstancesMetadata.prototype.instanceTargets = $util.emptyArray; /** - * Creates a new CreateInstanceRequests instance using the specified properties. + * 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.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata * @static - * @param {google.cloud.alloydb.v1.ICreateInstanceRequests=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.CreateInstanceRequests} CreateInstanceRequests instance + * @param {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata instance */ - CreateInstanceRequests.create = function create(properties) { - return new CreateInstanceRequests(properties); + BatchCreateInstancesMetadata.create = function create(properties) { + return new BatchCreateInstancesMetadata(properties); }; /** - * Encodes the specified CreateInstanceRequests message. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequests.verify|verify} messages. + * Encodes the specified BatchCreateInstancesMetadata message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata * @static - * @param {google.cloud.alloydb.v1.ICreateInstanceRequests} message CreateInstanceRequests message or plain object to encode + * @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 */ - CreateInstanceRequests.encode = function encode(message, writer) { + BatchCreateInstancesMetadata.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(); + 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 CreateInstanceRequests message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.CreateInstanceRequests.verify|verify} messages. + * 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.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata * @static - * @param {google.cloud.alloydb.v1.ICreateInstanceRequests} message CreateInstanceRequests message or plain object to encode + * @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 */ - CreateInstanceRequests.encodeDelimited = function encodeDelimited(message, writer) { + BatchCreateInstancesMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateInstanceRequests message from the specified reader or buffer. + * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @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.CreateInstanceRequests} CreateInstanceRequests + * @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 */ - CreateInstanceRequests.decode = function decode(reader, length) { + BatchCreateInstancesMetadata.decode = function decode(reader, length) { 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(); + 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(); 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())); + 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: @@ -15728,141 +20555,165 @@ }; /** - * Decodes a CreateInstanceRequests message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.CreateInstanceRequests} CreateInstanceRequests + * @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 */ - CreateInstanceRequests.decodeDelimited = function decodeDelimited(reader) { + BatchCreateInstancesMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateInstanceRequests message. + * Verifies a BatchCreateInstancesMetadata message. * @function verify - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @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 */ - CreateInstanceRequests.verify = function verify(message) { + BatchCreateInstancesMetadata.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 (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 "createInstanceRequests." + error; + return "instanceStatuses." + error; } } return null; }; /** - * Creates a CreateInstanceRequests message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateInstancesMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.CreateInstanceRequests} CreateInstanceRequests + * @returns {google.cloud.alloydb.v1.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata */ - CreateInstanceRequests.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.CreateInstanceRequests) + BatchCreateInstancesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata) 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]); + 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 CreateInstanceRequests message. Also converts values to other types if specified. + * Creates a plain object from a BatchCreateInstancesMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata * @static - * @param {google.cloud.alloydb.v1.CreateInstanceRequests} message CreateInstanceRequests + * @param {google.cloud.alloydb.v1.BatchCreateInstancesMetadata} message BatchCreateInstancesMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateInstanceRequests.toObject = function toObject(message, options) { + BatchCreateInstancesMetadata.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); + 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 CreateInstanceRequests to JSON. + * Converts this BatchCreateInstancesMetadata to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata * @instance * @returns {Object.} JSON object */ - CreateInstanceRequests.prototype.toJSON = function toJSON() { + BatchCreateInstancesMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateInstanceRequests + * Gets the default type url for BatchCreateInstancesMetadata * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.CreateInstanceRequests + * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateInstanceRequests.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BatchCreateInstancesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.CreateInstanceRequests"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.BatchCreateInstancesMetadata"; }; - return CreateInstanceRequests; + return BatchCreateInstancesMetadata; })(); - v1.BatchCreateInstancesRequest = (function() { + v1.BatchCreateInstanceStatus = (function() { /** - * Properties of a BatchCreateInstancesRequest. + * Properties of a BatchCreateInstanceStatus. * @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 + * @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 BatchCreateInstancesRequest. + * Constructs a new BatchCreateInstanceStatus. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a BatchCreateInstancesRequest. - * @implements IBatchCreateInstancesRequest + * @classdesc Represents a BatchCreateInstanceStatus. + * @implements IBatchCreateInstanceStatus * @constructor - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IBatchCreateInstanceStatus=} [properties] Properties to set */ - function BatchCreateInstancesRequest(properties) { + function BatchCreateInstanceStatus(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15870,103 +20721,117 @@ } /** - * BatchCreateInstancesRequest parent. - * @member {string} parent - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * BatchCreateInstanceStatus state. + * @member {google.cloud.alloydb.v1.BatchCreateInstanceStatus.State} state + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus * @instance */ - BatchCreateInstancesRequest.prototype.parent = ""; + BatchCreateInstanceStatus.prototype.state = 0; /** - * BatchCreateInstancesRequest requests. - * @member {google.cloud.alloydb.v1.ICreateInstanceRequests|null|undefined} requests - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * BatchCreateInstanceStatus errorMsg. + * @member {string} errorMsg + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus * @instance */ - BatchCreateInstancesRequest.prototype.requests = null; + BatchCreateInstanceStatus.prototype.errorMsg = ""; /** - * BatchCreateInstancesRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * BatchCreateInstanceStatus error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus * @instance */ - BatchCreateInstancesRequest.prototype.requestId = ""; + BatchCreateInstanceStatus.prototype.error = null; /** - * Creates a new BatchCreateInstancesRequest instance using the specified properties. + * 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.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesRequest} BatchCreateInstancesRequest instance + * @param {google.cloud.alloydb.v1.IBatchCreateInstanceStatus=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.BatchCreateInstanceStatus} BatchCreateInstanceStatus instance */ - BatchCreateInstancesRequest.create = function create(properties) { - return new BatchCreateInstancesRequest(properties); + BatchCreateInstanceStatus.create = function create(properties) { + return new BatchCreateInstanceStatus(properties); }; /** - * Encodes the specified BatchCreateInstancesRequest message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesRequest.verify|verify} messages. + * Encodes the specified BatchCreateInstanceStatus message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstanceStatus.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest} message BatchCreateInstancesRequest message or plain object to encode + * @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 */ - BatchCreateInstancesRequest.encode = function encode(message, writer) { + BatchCreateInstanceStatus.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); + 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 BatchCreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesRequest.verify|verify} messages. + * 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.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesRequest} message BatchCreateInstancesRequest message or plain object to encode + * @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 */ - BatchCreateInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + BatchCreateInstanceStatus.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer. + * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @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.BatchCreateInstancesRequest} BatchCreateInstancesRequest + * @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 */ - BatchCreateInstancesRequest.decode = function decode(reader, length) { + BatchCreateInstanceStatus.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.state = reader.int32(); break; } case 2: { - message.requests = $root.google.cloud.alloydb.v1.CreateInstanceRequests.decode(reader, reader.uint32()); + message.errorMsg = reader.string(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); break; } case 3: { - message.requestId = reader.string(); + message.type = reader.int32(); break; } default: @@ -15978,145 +20843,253 @@ }; /** - * Decodes a BatchCreateInstancesRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesRequest} BatchCreateInstancesRequest + * @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 */ - BatchCreateInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + BatchCreateInstanceStatus.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchCreateInstancesRequest message. + * Verifies a BatchCreateInstanceStatus message. * @function verify - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @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 */ - BatchCreateInstancesRequest.verify = function verify(message) { + BatchCreateInstanceStatus.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 (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 "requests." + error; + return "error." + error; } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; + 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 BatchCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateInstanceStatus message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesRequest} BatchCreateInstancesRequest + * @returns {google.cloud.alloydb.v1.BatchCreateInstanceStatus} BatchCreateInstanceStatus */ - BatchCreateInstancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.BatchCreateInstancesRequest) + BatchCreateInstanceStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus) 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); + 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; } - 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. + * Creates a plain object from a BatchCreateInstanceStatus message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus * @static - * @param {google.cloud.alloydb.v1.BatchCreateInstancesRequest} message BatchCreateInstancesRequest + * @param {google.cloud.alloydb.v1.BatchCreateInstanceStatus} message BatchCreateInstanceStatus * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchCreateInstancesRequest.toObject = function toObject(message, options) { + BatchCreateInstanceStatus.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.requests = null; - object.requestId = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.errorMsg = ""; + object.type = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; + object.error = null; } - 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; + 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 BatchCreateInstancesRequest to JSON. + * Converts this BatchCreateInstanceStatus to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus * @instance * @returns {Object.} JSON object */ - BatchCreateInstancesRequest.prototype.toJSON = function toJSON() { + BatchCreateInstanceStatus.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BatchCreateInstancesRequest + * Gets the default type url for BatchCreateInstanceStatus * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesRequest + * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BatchCreateInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BatchCreateInstanceStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.BatchCreateInstancesRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.BatchCreateInstanceStatus"; }; - return BatchCreateInstancesRequest; + /** + * 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.BatchCreateInstancesResponse = (function() { + v1.UpdateInstanceRequest = (function() { /** - * Properties of a BatchCreateInstancesResponse. + * Properties of an UpdateInstanceRequest. * @memberof google.cloud.alloydb.v1 - * @interface IBatchCreateInstancesResponse - * @property {Array.|null} [instances] BatchCreateInstancesResponse instances + * @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 BatchCreateInstancesResponse. + * Constructs a new UpdateInstanceRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a BatchCreateInstancesResponse. - * @implements IBatchCreateInstancesResponse + * @classdesc Represents an UpdateInstanceRequest. + * @implements IUpdateInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesResponse=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest=} [properties] Properties to set */ - function BatchCreateInstancesResponse(properties) { - this.instances = []; + function UpdateInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16124,78 +21097,131 @@ } /** - * BatchCreateInstancesResponse instances. - * @member {Array.} instances - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * UpdateInstanceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest * @instance */ - BatchCreateInstancesResponse.prototype.instances = $util.emptyArray; + UpdateInstanceRequest.prototype.updateMask = null; /** - * Creates a new BatchCreateInstancesResponse instance using the specified properties. + * 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.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesResponse=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesResponse} BatchCreateInstancesResponse instance + * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.UpdateInstanceRequest} UpdateInstanceRequest instance */ - BatchCreateInstancesResponse.create = function create(properties) { - return new BatchCreateInstancesResponse(properties); + UpdateInstanceRequest.create = function create(properties) { + return new UpdateInstanceRequest(properties); }; /** - * Encodes the specified BatchCreateInstancesResponse message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesResponse.verify|verify} messages. + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesResponse} message BatchCreateInstancesResponse message or plain object to encode + * @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 */ - BatchCreateInstancesResponse.encode = function encode(message, writer) { + UpdateInstanceRequest.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.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 BatchCreateInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesResponse.verify|verify} messages. + * 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.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesResponse} message BatchCreateInstancesResponse message or plain object to encode + * @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 */ - BatchCreateInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + UpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer. + * Decodes an UpdateInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @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.BatchCreateInstancesResponse} BatchCreateInstancesResponse + * @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 */ - BatchCreateInstancesResponse.decode = function decode(reader, length) { + UpdateInstanceRequest.decode = function decode(reader, length) { 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(); + 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(); 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())); + 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: @@ -16207,142 +21233,168 @@ }; /** - * Decodes a BatchCreateInstancesResponse message from the specified reader or buffer, length delimited. + * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesResponse} BatchCreateInstancesResponse + * @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 */ - BatchCreateInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + UpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchCreateInstancesResponse message. + * Verifies an UpdateInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @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 */ - BatchCreateInstancesResponse.verify = function verify(message) { + UpdateInstanceRequest.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.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 a BatchCreateInstancesResponse message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesResponse} BatchCreateInstancesResponse + * @returns {google.cloud.alloydb.v1.UpdateInstanceRequest} UpdateInstanceRequest */ - BatchCreateInstancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.BatchCreateInstancesResponse) + UpdateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.UpdateInstanceRequest) 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]); - } + 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 a BatchCreateInstancesResponse message. Also converts values to other types if specified. + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest * @static - * @param {google.cloud.alloydb.v1.BatchCreateInstancesResponse} message BatchCreateInstancesResponse + * @param {google.cloud.alloydb.v1.UpdateInstanceRequest} message UpdateInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchCreateInstancesResponse.toObject = function toObject(message, options) { + UpdateInstanceRequest.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); + 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 BatchCreateInstancesResponse to JSON. + * Converts this UpdateInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest * @instance * @returns {Object.} JSON object */ - BatchCreateInstancesResponse.prototype.toJSON = function toJSON() { + UpdateInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BatchCreateInstancesResponse + * Gets the default type url for UpdateInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesResponse + * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BatchCreateInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.BatchCreateInstancesResponse"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.UpdateInstanceRequest"; }; - return BatchCreateInstancesResponse; + return UpdateInstanceRequest; })(); - v1.BatchCreateInstancesMetadata = (function() { + v1.DeleteInstanceRequest = (function() { /** - * Properties of a BatchCreateInstancesMetadata. + * Properties of a DeleteInstanceRequest. * @memberof google.cloud.alloydb.v1 - * @interface IBatchCreateInstancesMetadata - * @property {Array.|null} [instanceTargets] BatchCreateInstancesMetadata instanceTargets - * @property {Object.|null} [instanceStatuses] BatchCreateInstancesMetadata instanceStatuses + * @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 BatchCreateInstancesMetadata. + * Constructs a new DeleteInstanceRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a BatchCreateInstancesMetadata. - * @implements IBatchCreateInstancesMetadata + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest=} [properties] Properties to set */ - function BatchCreateInstancesMetadata(properties) { - this.instanceTargets = []; - this.instanceStatuses = {}; + function DeleteInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16350,114 +21402,117 @@ } /** - * BatchCreateInstancesMetadata instanceTargets. - * @member {Array.} instanceTargets - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * DeleteInstanceRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest * @instance */ - BatchCreateInstancesMetadata.prototype.instanceTargets = $util.emptyArray; + DeleteInstanceRequest.prototype.name = ""; /** - * BatchCreateInstancesMetadata instanceStatuses. - * @member {Object.} instanceStatuses - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * DeleteInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest * @instance */ - BatchCreateInstancesMetadata.prototype.instanceStatuses = $util.emptyObject; + DeleteInstanceRequest.prototype.requestId = ""; /** - * Creates a new BatchCreateInstancesMetadata instance using the specified properties. + * 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.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata instance + * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.DeleteInstanceRequest} DeleteInstanceRequest instance */ - BatchCreateInstancesMetadata.create = function create(properties) { - return new BatchCreateInstancesMetadata(properties); + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); }; /** - * Encodes the specified BatchCreateInstancesMetadata message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesMetadata.verify|verify} messages. + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata} message BatchCreateInstancesMetadata message or plain object to encode + * @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 */ - BatchCreateInstancesMetadata.encode = function encode(message, writer) { + DeleteInstanceRequest.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(); - } + 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 BatchCreateInstancesMetadata message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstancesMetadata.verify|verify} messages. + * 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.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstancesMetadata} message BatchCreateInstancesMetadata message or plain object to encode + * @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 */ - BatchCreateInstancesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer. + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @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.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata + * @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 */ - BatchCreateInstancesMetadata.decode = function decode(reader, length) { + DeleteInstanceRequest.decode = function decode(reader, length) { 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; + 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(); switch (tag >>> 3) { case 1: { - if (!(message.instanceTargets && message.instanceTargets.length)) - message.instanceTargets = []; - message.instanceTargets.push(reader.string()); + message.name = 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; + message.requestId = reader.string(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); break; } default: @@ -16469,165 +21524,149 @@ }; /** - * Decodes a BatchCreateInstancesMetadata message from the specified reader or buffer, length delimited. + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata + * @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 */ - BatchCreateInstancesMetadata.decodeDelimited = function decodeDelimited(reader) { + DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchCreateInstancesMetadata message. + * Verifies a DeleteInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @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 */ - BatchCreateInstancesMetadata.verify = function verify(message) { + DeleteInstanceRequest.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; - } - } + 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 BatchCreateInstancesMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.BatchCreateInstancesMetadata} BatchCreateInstancesMetadata + * @returns {google.cloud.alloydb.v1.DeleteInstanceRequest} DeleteInstanceRequest */ - BatchCreateInstancesMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.BatchCreateInstancesMetadata) + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.DeleteInstanceRequest) 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]]); - } - } + 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 BatchCreateInstancesMetadata message. Also converts values to other types if specified. + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest * @static - * @param {google.cloud.alloydb.v1.BatchCreateInstancesMetadata} message BatchCreateInstancesMetadata + * @param {google.cloud.alloydb.v1.DeleteInstanceRequest} message DeleteInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchCreateInstancesMetadata.toObject = function toObject(message, options) { + DeleteInstanceRequest.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); + 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 BatchCreateInstancesMetadata to JSON. + * Converts this DeleteInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest * @instance * @returns {Object.} JSON object */ - BatchCreateInstancesMetadata.prototype.toJSON = function toJSON() { + DeleteInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BatchCreateInstancesMetadata + * Gets the default type url for DeleteInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.BatchCreateInstancesMetadata + * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BatchCreateInstancesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.BatchCreateInstancesMetadata"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.DeleteInstanceRequest"; }; - return BatchCreateInstancesMetadata; + return DeleteInstanceRequest; })(); - v1.BatchCreateInstanceStatus = (function() { + v1.FailoverInstanceRequest = (function() { /** - * Properties of a BatchCreateInstanceStatus. + * Properties of a FailoverInstanceRequest. * @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 + * @interface IFailoverInstanceRequest + * @property {string|null} [name] FailoverInstanceRequest name + * @property {string|null} [requestId] FailoverInstanceRequest requestId + * @property {boolean|null} [validateOnly] FailoverInstanceRequest validateOnly */ /** - * Constructs a new BatchCreateInstanceStatus. + * Constructs a new FailoverInstanceRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a BatchCreateInstanceStatus. - * @implements IBatchCreateInstanceStatus + * @classdesc Represents a FailoverInstanceRequest. + * @implements IFailoverInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1.IBatchCreateInstanceStatus=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest=} [properties] Properties to set */ - function BatchCreateInstanceStatus(properties) { + function FailoverInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16635,117 +21674,103 @@ } /** - * 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 + * FailoverInstanceRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest * @instance */ - BatchCreateInstanceStatus.prototype.errorMsg = ""; + FailoverInstanceRequest.prototype.name = ""; /** - * BatchCreateInstanceStatus error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * FailoverInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest * @instance */ - BatchCreateInstanceStatus.prototype.error = null; + FailoverInstanceRequest.prototype.requestId = ""; /** - * BatchCreateInstanceStatus type. - * @member {google.cloud.alloydb.v1.Instance.InstanceType} type - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * FailoverInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest * @instance */ - BatchCreateInstanceStatus.prototype.type = 0; + FailoverInstanceRequest.prototype.validateOnly = false; /** - * Creates a new BatchCreateInstanceStatus instance using the specified properties. + * Creates a new FailoverInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstanceStatus=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.BatchCreateInstanceStatus} BatchCreateInstanceStatus instance + * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.FailoverInstanceRequest} FailoverInstanceRequest instance */ - BatchCreateInstanceStatus.create = function create(properties) { - return new BatchCreateInstanceStatus(properties); + FailoverInstanceRequest.create = function create(properties) { + return new FailoverInstanceRequest(properties); }; /** - * Encodes the specified BatchCreateInstanceStatus message. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstanceStatus.verify|verify} messages. + * Encodes the specified FailoverInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.FailoverInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstanceStatus} message BatchCreateInstanceStatus message or plain object to encode + * @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 */ - BatchCreateInstanceStatus.encode = function encode(message, writer) { + FailoverInstanceRequest.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(); + 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 BatchCreateInstanceStatus message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.BatchCreateInstanceStatus.verify|verify} messages. + * 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.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IBatchCreateInstanceStatus} message BatchCreateInstanceStatus message or plain object to encode + * @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 */ - BatchCreateInstanceStatus.encodeDelimited = function encodeDelimited(message, writer) { + FailoverInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer. + * Decodes a FailoverInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @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.BatchCreateInstanceStatus} BatchCreateInstanceStatus + * @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 */ - BatchCreateInstanceStatus.decode = function decode(reader, length) { + FailoverInstanceRequest.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: { - message.state = reader.int32(); + message.name = reader.string(); break; } case 2: { - message.errorMsg = reader.string(); - break; - } - case 4: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + message.requestId = reader.string(); break; } case 3: { - message.type = reader.int32(); + message.validateOnly = reader.bool(); break; } default: @@ -16757,253 +21782,142 @@ }; /** - * Decodes a BatchCreateInstanceStatus message from the specified reader or buffer, length delimited. + * Decodes a FailoverInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.BatchCreateInstanceStatus} BatchCreateInstanceStatus + * @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 */ - BatchCreateInstanceStatus.decodeDelimited = function decodeDelimited(reader) { + FailoverInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchCreateInstanceStatus message. + * Verifies a FailoverInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @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 - */ - 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; - } + */ + 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 BatchCreateInstanceStatus message from a plain object. Also converts values to their respective internal types. + * Creates a FailoverInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.BatchCreateInstanceStatus} BatchCreateInstanceStatus + * @returns {google.cloud.alloydb.v1.FailoverInstanceRequest} FailoverInstanceRequest */ - BatchCreateInstanceStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.BatchCreateInstanceStatus) + FailoverInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.FailoverInstanceRequest) 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; - } + 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 BatchCreateInstanceStatus message. Also converts values to other types if specified. + * Creates a plain object from a FailoverInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest * @static - * @param {google.cloud.alloydb.v1.BatchCreateInstanceStatus} message BatchCreateInstanceStatus + * @param {google.cloud.alloydb.v1.FailoverInstanceRequest} message FailoverInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchCreateInstanceStatus.toObject = function toObject(message, options) { + FailoverInstanceRequest.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; + object.name = ""; + object.requestId = ""; + object.validateOnly = false; } - 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); + 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 BatchCreateInstanceStatus to JSON. + * Converts this FailoverInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest * @instance * @returns {Object.} JSON object */ - BatchCreateInstanceStatus.prototype.toJSON = function toJSON() { + FailoverInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BatchCreateInstanceStatus + * Gets the default type url for FailoverInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.BatchCreateInstanceStatus + * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BatchCreateInstanceStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FailoverInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.BatchCreateInstanceStatus"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.FailoverInstanceRequest"; }; - /** - * 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; + return FailoverInstanceRequest; })(); - v1.UpdateInstanceRequest = (function() { + v1.InjectFaultRequest = (function() { /** - * Properties of an UpdateInstanceRequest. + * Properties of an InjectFaultRequest. * @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 + * @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 UpdateInstanceRequest. + * Constructs a new InjectFaultRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an UpdateInstanceRequest. - * @implements IUpdateInstanceRequest + * @classdesc Represents an InjectFaultRequest. + * @implements IInjectFaultRequest * @constructor - * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IInjectFaultRequest=} [properties] Properties to set */ - function UpdateInstanceRequest(properties) { + function InjectFaultRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17011,119 +21925,109 @@ } /** - * UpdateInstanceRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * InjectFaultRequest faultType. + * @member {google.cloud.alloydb.v1.InjectFaultRequest.FaultType} faultType + * @memberof google.cloud.alloydb.v1.InjectFaultRequest * @instance */ - UpdateInstanceRequest.prototype.updateMask = null; + InjectFaultRequest.prototype.faultType = 0; /** - * UpdateInstanceRequest instance. - * @member {google.cloud.alloydb.v1.IInstance|null|undefined} instance - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * InjectFaultRequest name. + * @member {string} name + * @memberof google.cloud.alloydb.v1.InjectFaultRequest * @instance */ - UpdateInstanceRequest.prototype.instance = null; + InjectFaultRequest.prototype.name = ""; /** - * UpdateInstanceRequest requestId. + * InjectFaultRequest requestId. * @member {string} requestId - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1.InjectFaultRequest * @instance */ - UpdateInstanceRequest.prototype.requestId = ""; + InjectFaultRequest.prototype.requestId = ""; /** - * UpdateInstanceRequest validateOnly. + * InjectFaultRequest 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 + * @memberof google.cloud.alloydb.v1.InjectFaultRequest * @instance */ - UpdateInstanceRequest.prototype.allowMissing = false; + InjectFaultRequest.prototype.validateOnly = false; /** - * Creates a new UpdateInstanceRequest instance using the specified properties. + * Creates a new InjectFaultRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1.InjectFaultRequest * @static - * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.UpdateInstanceRequest} UpdateInstanceRequest instance + * @param {google.cloud.alloydb.v1.IInjectFaultRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.InjectFaultRequest} InjectFaultRequest instance */ - UpdateInstanceRequest.create = function create(properties) { - return new UpdateInstanceRequest(properties); + InjectFaultRequest.create = function create(properties) { + return new InjectFaultRequest(properties); }; /** - * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.UpdateInstanceRequest.verify|verify} messages. + * Encodes the specified InjectFaultRequest message. Does not implicitly {@link google.cloud.alloydb.v1.InjectFaultRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1.InjectFaultRequest * @static - * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @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 */ - UpdateInstanceRequest.encode = function encode(message, writer) { + InjectFaultRequest.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.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); - 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. + * 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.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1.InjectFaultRequest * @static - * @param {google.cloud.alloydb.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @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 */ - UpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + InjectFaultRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer. + * Decodes an InjectFaultRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @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.UpdateInstanceRequest} UpdateInstanceRequest + * @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 */ - UpdateInstanceRequest.decode = function decode(reader, length) { + InjectFaultRequest.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.faultType = reader.int32(); break; } case 2: { - message.instance = $root.google.cloud.alloydb.v1.Instance.decode(reader, reader.uint32()); + message.name = reader.string(); break; } case 3: { @@ -17134,10 +22038,6 @@ message.validateOnly = reader.bool(); break; } - case 5: { - message.allowMissing = reader.bool(); - break; - } default: reader.skipType(tag & 7); break; @@ -17147,168 +22047,184 @@ }; /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes an InjectFaultRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1.InjectFaultRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.UpdateInstanceRequest} UpdateInstanceRequest + * @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 */ - UpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + InjectFaultRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateInstanceRequest message. + * Verifies an InjectFaultRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @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 */ - UpdateInstanceRequest.verify = function verify(message) { + InjectFaultRequest.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.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"; - 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. + * Creates an InjectFaultRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1.InjectFaultRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.UpdateInstanceRequest} UpdateInstanceRequest + * @returns {google.cloud.alloydb.v1.InjectFaultRequest} InjectFaultRequest */ - UpdateInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.UpdateInstanceRequest) + InjectFaultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.InjectFaultRequest) 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); + 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); - 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. + * Creates a plain object from an InjectFaultRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1.InjectFaultRequest * @static - * @param {google.cloud.alloydb.v1.UpdateInstanceRequest} message UpdateInstanceRequest + * @param {google.cloud.alloydb.v1.InjectFaultRequest} message InjectFaultRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateInstanceRequest.toObject = function toObject(message, options) { + InjectFaultRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.updateMask = null; - object.instance = null; + object.faultType = options.enums === String ? "FAULT_TYPE_UNSPECIFIED" : 0; + object.name = ""; 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.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; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; return object; }; /** - * Converts this UpdateInstanceRequest to JSON. + * Converts this InjectFaultRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1.InjectFaultRequest * @instance * @returns {Object.} JSON object */ - UpdateInstanceRequest.prototype.toJSON = function toJSON() { + InjectFaultRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateInstanceRequest + * Gets the default type url for InjectFaultRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.UpdateInstanceRequest + * @memberof google.cloud.alloydb.v1.InjectFaultRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + InjectFaultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.UpdateInstanceRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.InjectFaultRequest"; }; - return UpdateInstanceRequest; + /** + * 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.DeleteInstanceRequest = (function() { + v1.RestartInstanceRequest = (function() { /** - * Properties of a DeleteInstanceRequest. + * Properties of a RestartInstanceRequest. * @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 + * @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 DeleteInstanceRequest. + * Constructs a new RestartInstanceRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a DeleteInstanceRequest. - * @implements IDeleteInstanceRequest + * @classdesc Represents a RestartInstanceRequest. + * @implements IRestartInstanceRequest * @constructor - * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IRestartInstanceRequest=} [properties] Properties to set */ - function DeleteInstanceRequest(properties) { + function RestartInstanceRequest(properties) { + this.nodeIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17316,100 +22232,101 @@ } /** - * DeleteInstanceRequest name. + * RestartInstanceRequest name. * @member {string} name - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest * @instance */ - DeleteInstanceRequest.prototype.name = ""; + RestartInstanceRequest.prototype.name = ""; /** - * DeleteInstanceRequest requestId. + * RestartInstanceRequest requestId. * @member {string} requestId - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest * @instance */ - DeleteInstanceRequest.prototype.requestId = ""; + RestartInstanceRequest.prototype.requestId = ""; /** - * DeleteInstanceRequest etag. - * @member {string} etag - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * RestartInstanceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest * @instance */ - DeleteInstanceRequest.prototype.etag = ""; + RestartInstanceRequest.prototype.validateOnly = false; /** - * DeleteInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * RestartInstanceRequest nodeIds. + * @member {Array.} nodeIds + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest * @instance */ - DeleteInstanceRequest.prototype.validateOnly = false; + RestartInstanceRequest.prototype.nodeIds = $util.emptyArray; /** - * Creates a new DeleteInstanceRequest instance using the specified properties. + * Creates a new RestartInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.DeleteInstanceRequest} DeleteInstanceRequest instance + * @param {google.cloud.alloydb.v1.IRestartInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.RestartInstanceRequest} RestartInstanceRequest instance */ - DeleteInstanceRequest.create = function create(properties) { - return new DeleteInstanceRequest(properties); + RestartInstanceRequest.create = function create(properties) { + return new RestartInstanceRequest(properties); }; /** - * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.DeleteInstanceRequest.verify|verify} messages. + * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.RestartInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @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 */ - DeleteInstanceRequest.encode = function encode(message, 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.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); + 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 DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.DeleteInstanceRequest.verify|verify} messages. + * 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.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest * @static - * @param {google.cloud.alloydb.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @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 */ - DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + RestartInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * Decodes a RestartInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @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.DeleteInstanceRequest} DeleteInstanceRequest + * @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 */ - DeleteInstanceRequest.decode = function decode(reader, length) { + RestartInstanceRequest.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { @@ -17422,11 +22339,13 @@ break; } case 3: { - message.etag = reader.string(); + message.validateOnly = reader.bool(); break; } case 4: { - message.validateOnly = reader.bool(); + if (!(message.nodeIds && message.nodeIds.length)) + message.nodeIds = []; + message.nodeIds.push(reader.string()); break; } default: @@ -17438,30 +22357,30 @@ }; /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.DeleteInstanceRequest} DeleteInstanceRequest + * @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 */ - DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + RestartInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteInstanceRequest message. + * Verifies a RestartInstanceRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @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 */ - DeleteInstanceRequest.verify = function verify(message) { + RestartInstanceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -17470,117 +22389,132 @@ 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.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 DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.DeleteInstanceRequest} DeleteInstanceRequest + * @returns {google.cloud.alloydb.v1.RestartInstanceRequest} RestartInstanceRequest */ - DeleteInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.DeleteInstanceRequest) + RestartInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.RestartInstanceRequest) return object; - var message = new $root.google.cloud.alloydb.v1.DeleteInstanceRequest(); + 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.etag != null) - message.etag = String(object.etag); 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 DeleteInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from a RestartInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest * @static - * @param {google.cloud.alloydb.v1.DeleteInstanceRequest} message DeleteInstanceRequest + * @param {google.cloud.alloydb.v1.RestartInstanceRequest} message RestartInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteInstanceRequest.toObject = function toObject(message, options) { + 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.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; + 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 DeleteInstanceRequest to JSON. + * Converts this RestartInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest * @instance * @returns {Object.} JSON object */ - DeleteInstanceRequest.prototype.toJSON = function toJSON() { + RestartInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteInstanceRequest + * Gets the default type url for RestartInstanceRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.DeleteInstanceRequest + * @memberof google.cloud.alloydb.v1.RestartInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RestartInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.DeleteInstanceRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.RestartInstanceRequest"; }; - return DeleteInstanceRequest; + return RestartInstanceRequest; })(); - v1.FailoverInstanceRequest = (function() { + v1.ExecuteSqlRequest = (function() { /** - * Properties of a FailoverInstanceRequest. + * Properties of an ExecuteSqlRequest. * @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 + * @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 */ /** - * Constructs a new FailoverInstanceRequest. + * Constructs a new ExecuteSqlRequest. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a FailoverInstanceRequest. - * @implements IFailoverInstanceRequest + * @classdesc Represents an ExecuteSqlRequest. + * @implements IExecuteSqlRequest * @constructor - * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IExecuteSqlRequest=} [properties] Properties to set */ - function FailoverInstanceRequest(properties) { + function ExecuteSqlRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17588,103 +22522,145 @@ } /** - * FailoverInstanceRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * ExecuteSqlRequest password. + * @member {string|null|undefined} password + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest * @instance */ - FailoverInstanceRequest.prototype.name = ""; + ExecuteSqlRequest.prototype.password = null; /** - * FailoverInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * ExecuteSqlRequest instance. + * @member {string} instance + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest * @instance */ - FailoverInstanceRequest.prototype.requestId = ""; + ExecuteSqlRequest.prototype.instance = ""; /** - * FailoverInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * ExecuteSqlRequest database. + * @member {string} database + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest * @instance */ - FailoverInstanceRequest.prototype.validateOnly = false; + ExecuteSqlRequest.prototype.database = ""; /** - * Creates a new FailoverInstanceRequest instance using the specified properties. + * 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 = ""; + + // 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.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest * @static - * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.FailoverInstanceRequest} FailoverInstanceRequest instance + * @param {google.cloud.alloydb.v1.IExecuteSqlRequest=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ExecuteSqlRequest} ExecuteSqlRequest instance */ - FailoverInstanceRequest.create = function create(properties) { - return new FailoverInstanceRequest(properties); + ExecuteSqlRequest.create = function create(properties) { + return new ExecuteSqlRequest(properties); }; /** - * Encodes the specified FailoverInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.FailoverInstanceRequest.verify|verify} messages. + * Encodes the specified ExecuteSqlRequest message. Does not implicitly {@link google.cloud.alloydb.v1.ExecuteSqlRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest * @static - * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest} message FailoverInstanceRequest message or plain object to encode + * @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 */ - FailoverInstanceRequest.encode = function encode(message, writer) { + ExecuteSqlRequest.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.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); return writer; }; /** - * Encodes the specified FailoverInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.FailoverInstanceRequest.verify|verify} messages. + * 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.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest * @static - * @param {google.cloud.alloydb.v1.IFailoverInstanceRequest} message FailoverInstanceRequest message or plain object to encode + * @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 */ - FailoverInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + ExecuteSqlRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FailoverInstanceRequest message from the specified reader or buffer. + * Decodes an ExecuteSqlRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @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.FailoverInstanceRequest} FailoverInstanceRequest + * @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 */ - FailoverInstanceRequest.decode = function decode(reader, length) { + ExecuteSqlRequest.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { + case 5: { + message.password = reader.string(); + break; + } case 1: { - message.name = reader.string(); + message.instance = reader.string(); break; } case 2: { - message.requestId = reader.string(); + message.database = reader.string(); break; } case 3: { - message.validateOnly = reader.bool(); + message.user = reader.string(); + break; + } + case 4: { + message.sqlStatement = reader.string(); break; } default: @@ -17696,142 +22672,162 @@ }; /** - * Decodes a FailoverInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes an ExecuteSqlRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.FailoverInstanceRequest} FailoverInstanceRequest + * @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 */ - FailoverInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + ExecuteSqlRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FailoverInstanceRequest message. + * Verifies an ExecuteSqlRequest message. * @function verify - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @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 */ - FailoverInstanceRequest.verify = function verify(message) { + ExecuteSqlRequest.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"; + 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"; return null; }; /** - * Creates a FailoverInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExecuteSqlRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.FailoverInstanceRequest} FailoverInstanceRequest + * @returns {google.cloud.alloydb.v1.ExecuteSqlRequest} ExecuteSqlRequest */ - FailoverInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.FailoverInstanceRequest) + ExecuteSqlRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ExecuteSqlRequest) 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); + 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); return message; }; /** - * Creates a plain object from a FailoverInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from an ExecuteSqlRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest * @static - * @param {google.cloud.alloydb.v1.FailoverInstanceRequest} message FailoverInstanceRequest + * @param {google.cloud.alloydb.v1.ExecuteSqlRequest} message ExecuteSqlRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FailoverInstanceRequest.toObject = function toObject(message, options) { + ExecuteSqlRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.validateOnly = false; + object.instance = ""; + object.database = ""; + object.user = ""; + object.sqlStatement = ""; + } + 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.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. + * Converts this ExecuteSqlRequest to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest * @instance * @returns {Object.} JSON object */ - FailoverInstanceRequest.prototype.toJSON = function toJSON() { + ExecuteSqlRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FailoverInstanceRequest + * Gets the default type url for ExecuteSqlRequest * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.FailoverInstanceRequest + * @memberof google.cloud.alloydb.v1.ExecuteSqlRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FailoverInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ExecuteSqlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.FailoverInstanceRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.ExecuteSqlRequest"; }; - return FailoverInstanceRequest; + return ExecuteSqlRequest; })(); - v1.InjectFaultRequest = (function() { + v1.ExecuteSqlResponse = (function() { /** - * Properties of an InjectFaultRequest. + * Properties of an ExecuteSqlResponse. * @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 + * @interface IExecuteSqlResponse + * @property {Array.|null} [sqlResults] ExecuteSqlResponse sqlResults + * @property {google.cloud.alloydb.v1.IExecuteSqlMetadata|null} [metadata] ExecuteSqlResponse metadata */ /** - * Constructs a new InjectFaultRequest. + * Constructs a new ExecuteSqlResponse. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents an InjectFaultRequest. - * @implements IInjectFaultRequest + * @classdesc Represents an ExecuteSqlResponse. + * @implements IExecuteSqlResponse * @constructor - * @param {google.cloud.alloydb.v1.IInjectFaultRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IExecuteSqlResponse=} [properties] Properties to set */ - function InjectFaultRequest(properties) { + function ExecuteSqlResponse(properties) { + this.sqlResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17839,117 +22835,92 @@ } /** - * 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 + * ExecuteSqlResponse sqlResults. + * @member {Array.} sqlResults + * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse * @instance */ - InjectFaultRequest.prototype.requestId = ""; + ExecuteSqlResponse.prototype.sqlResults = $util.emptyArray; /** - * InjectFaultRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.InjectFaultRequest + * ExecuteSqlResponse metadata. + * @member {google.cloud.alloydb.v1.IExecuteSqlMetadata|null|undefined} metadata + * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse * @instance */ - InjectFaultRequest.prototype.validateOnly = false; + ExecuteSqlResponse.prototype.metadata = null; /** - * Creates a new InjectFaultRequest instance using the specified properties. + * Creates a new ExecuteSqlResponse instance using the specified properties. * @function create - * @memberof google.cloud.alloydb.v1.InjectFaultRequest + * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse * @static - * @param {google.cloud.alloydb.v1.IInjectFaultRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.InjectFaultRequest} InjectFaultRequest instance + * @param {google.cloud.alloydb.v1.IExecuteSqlResponse=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ExecuteSqlResponse} ExecuteSqlResponse instance */ - InjectFaultRequest.create = function create(properties) { - return new InjectFaultRequest(properties); + ExecuteSqlResponse.create = function create(properties) { + return new ExecuteSqlResponse(properties); }; /** - * Encodes the specified InjectFaultRequest message. Does not implicitly {@link google.cloud.alloydb.v1.InjectFaultRequest.verify|verify} messages. + * Encodes the specified ExecuteSqlResponse message. Does not implicitly {@link google.cloud.alloydb.v1.ExecuteSqlResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.InjectFaultRequest + * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse * @static - * @param {google.cloud.alloydb.v1.IInjectFaultRequest} message InjectFaultRequest message or plain object to encode + * @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 */ - InjectFaultRequest.encode = function encode(message, writer) { + ExecuteSqlResponse.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); + 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 InjectFaultRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.InjectFaultRequest.verify|verify} messages. + * 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.InjectFaultRequest + * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse * @static - * @param {google.cloud.alloydb.v1.IInjectFaultRequest} message InjectFaultRequest message or plain object to encode + * @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 */ - InjectFaultRequest.encodeDelimited = function encodeDelimited(message, writer) { + ExecuteSqlResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an InjectFaultRequest message from the specified reader or buffer. + * Decodes an ExecuteSqlResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.InjectFaultRequest + * @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.InjectFaultRequest} InjectFaultRequest + * @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 */ - InjectFaultRequest.decode = function decode(reader, length) { + ExecuteSqlResponse.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: { - message.faultType = reader.int32(); - break; - } - case 2: { - message.name = reader.string(); + 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.requestId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); + message.metadata = $root.google.cloud.alloydb.v1.ExecuteSqlMetadata.decode(reader, reader.uint32()); break; } default: @@ -17961,182 +22932,156 @@ }; /** - * Decodes an InjectFaultRequest message from the specified reader or buffer, length delimited. + * Decodes an ExecuteSqlResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.InjectFaultRequest + * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.InjectFaultRequest} InjectFaultRequest + * @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 */ - InjectFaultRequest.decodeDelimited = function decodeDelimited(reader) { + ExecuteSqlResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an InjectFaultRequest message. + * Verifies an ExecuteSqlResponse message. * @function verify - * @memberof google.cloud.alloydb.v1.InjectFaultRequest + * @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 */ - InjectFaultRequest.verify = function verify(message) { + ExecuteSqlResponse.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.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.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.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 InjectFaultRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExecuteSqlResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.InjectFaultRequest + * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.InjectFaultRequest} InjectFaultRequest + * @returns {google.cloud.alloydb.v1.ExecuteSqlResponse} ExecuteSqlResponse */ - InjectFaultRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.InjectFaultRequest) + ExecuteSqlResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ExecuteSqlResponse) 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; + 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); } - 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. + * Creates a plain object from an ExecuteSqlResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.InjectFaultRequest + * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse * @static - * @param {google.cloud.alloydb.v1.InjectFaultRequest} message InjectFaultRequest + * @param {google.cloud.alloydb.v1.ExecuteSqlResponse} message ExecuteSqlResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InjectFaultRequest.toObject = function toObject(message, options) { + ExecuteSqlResponse.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; + 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 InjectFaultRequest to JSON. + * Converts this ExecuteSqlResponse to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.InjectFaultRequest + * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse * @instance * @returns {Object.} JSON object */ - InjectFaultRequest.prototype.toJSON = function toJSON() { + ExecuteSqlResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for InjectFaultRequest + * Gets the default type url for ExecuteSqlResponse * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.InjectFaultRequest + * @memberof google.cloud.alloydb.v1.ExecuteSqlResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - InjectFaultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ExecuteSqlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.InjectFaultRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.ExecuteSqlResponse"; }; - /** - * 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; + return ExecuteSqlResponse; })(); - v1.RestartInstanceRequest = (function() { + v1.ExecuteSqlMetadata = (function() { /** - * Properties of a RestartInstanceRequest. + * Properties of an ExecuteSqlMetadata. * @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 + * @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 RestartInstanceRequest. + * Constructs a new ExecuteSqlMetadata. * @memberof google.cloud.alloydb.v1 - * @classdesc Represents a RestartInstanceRequest. - * @implements IRestartInstanceRequest + * @classdesc Represents an ExecuteSqlMetadata. + * @implements IExecuteSqlMetadata * @constructor - * @param {google.cloud.alloydb.v1.IRestartInstanceRequest=} [properties] Properties to set + * @param {google.cloud.alloydb.v1.IExecuteSqlMetadata=} [properties] Properties to set */ - function RestartInstanceRequest(properties) { + function ExecuteSqlMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -18144,103 +23089,117 @@ } /** - * RestartInstanceRequest name. - * @member {string} name - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * ExecuteSqlMetadata message. + * @member {string} message + * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata * @instance */ - RestartInstanceRequest.prototype.name = ""; + ExecuteSqlMetadata.prototype.message = ""; /** - * RestartInstanceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * ExecuteSqlMetadata partialResult. + * @member {boolean} partialResult + * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata * @instance */ - RestartInstanceRequest.prototype.requestId = ""; + ExecuteSqlMetadata.prototype.partialResult = false; /** - * RestartInstanceRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * ExecuteSqlMetadata sqlStatementExecutionDuration. + * @member {google.protobuf.IDuration|null|undefined} sqlStatementExecutionDuration + * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata * @instance */ - RestartInstanceRequest.prototype.validateOnly = false; + ExecuteSqlMetadata.prototype.sqlStatementExecutionDuration = null; /** - * Creates a new RestartInstanceRequest instance using the specified properties. + * 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.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata * @static - * @param {google.cloud.alloydb.v1.IRestartInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.alloydb.v1.RestartInstanceRequest} RestartInstanceRequest instance + * @param {google.cloud.alloydb.v1.IExecuteSqlMetadata=} [properties] Properties to set + * @returns {google.cloud.alloydb.v1.ExecuteSqlMetadata} ExecuteSqlMetadata instance */ - RestartInstanceRequest.create = function create(properties) { - return new RestartInstanceRequest(properties); + ExecuteSqlMetadata.create = function create(properties) { + return new ExecuteSqlMetadata(properties); }; /** - * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.alloydb.v1.RestartInstanceRequest.verify|verify} messages. + * Encodes the specified ExecuteSqlMetadata message. Does not implicitly {@link google.cloud.alloydb.v1.ExecuteSqlMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata * @static - * @param {google.cloud.alloydb.v1.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode + * @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 */ - RestartInstanceRequest.encode = function encode(message, writer) { + ExecuteSqlMetadata.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.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 RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.alloydb.v1.RestartInstanceRequest.verify|verify} messages. + * 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.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata * @static - * @param {google.cloud.alloydb.v1.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode + * @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 */ - RestartInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + ExecuteSqlMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RestartInstanceRequest message from the specified reader or buffer. + * Decodes an ExecuteSqlMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @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.RestartInstanceRequest} RestartInstanceRequest + * @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 */ - RestartInstanceRequest.decode = function decode(reader, length) { + ExecuteSqlMetadata.decode = function decode(reader, length) { 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(); + 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(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.message = reader.string(); break; } case 2: { - message.requestId = reader.string(); + message.partialResult = reader.bool(); break; } case 3: { - message.validateOnly = reader.bool(); + message.sqlStatementExecutionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.status = reader.int32(); break; } default: @@ -18252,119 +23211,179 @@ }; /** - * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes an ExecuteSqlMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.alloydb.v1.RestartInstanceRequest} RestartInstanceRequest + * @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 */ - RestartInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + ExecuteSqlMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RestartInstanceRequest message. + * Verifies an ExecuteSqlMetadata message. * @function verify - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @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 */ - RestartInstanceRequest.verify = function verify(message) { + ExecuteSqlMetadata.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.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 a RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExecuteSqlMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.alloydb.v1.RestartInstanceRequest} RestartInstanceRequest + * @returns {google.cloud.alloydb.v1.ExecuteSqlMetadata} ExecuteSqlMetadata */ - RestartInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.alloydb.v1.RestartInstanceRequest) + ExecuteSqlMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.alloydb.v1.ExecuteSqlMetadata) 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); + 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 a RestartInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from an ExecuteSqlMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata * @static - * @param {google.cloud.alloydb.v1.RestartInstanceRequest} message RestartInstanceRequest + * @param {google.cloud.alloydb.v1.ExecuteSqlMetadata} message ExecuteSqlMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RestartInstanceRequest.toObject = function toObject(message, options) { + ExecuteSqlMetadata.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; + 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 RestartInstanceRequest to JSON. + * Converts this ExecuteSqlMetadata to JSON. * @function toJSON - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata * @instance * @returns {Object.} JSON object */ - RestartInstanceRequest.prototype.toJSON = function toJSON() { + ExecuteSqlMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RestartInstanceRequest + * Gets the default type url for ExecuteSqlMetadata * @function getTypeUrl - * @memberof google.cloud.alloydb.v1.RestartInstanceRequest + * @memberof google.cloud.alloydb.v1.ExecuteSqlMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RestartInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ExecuteSqlMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.alloydb.v1.RestartInstanceRequest"; + return typeUrlPrefix + "/google.cloud.alloydb.v1.ExecuteSqlMetadata"; }; - return RestartInstanceRequest; + /** + * 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() { @@ -23347,6 +28366,527 @@ 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) { + 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(); + 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) { + 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(); + 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; + })(); + return v1; })(); @@ -76026,6 +81566,263 @@ return values; })(); + 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) { + 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(); + 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; + })(); + api.ResourceDescriptor = (function() { /** @@ -81602,263 +87399,6 @@ return values; })(); - 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) { - 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(); - 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; })(); @@ -88032,8 +93572,8 @@ * @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 + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference */ /** @@ -88168,20 +93708,20 @@ FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * FieldOptions .google.api.fieldInfo. + * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo * @memberof google.protobuf.FieldOptions * @instance */ - FieldOptions.prototype[".google.api.resourceReference"] = null; + FieldOptions.prototype[".google.api.fieldInfo"] = null; /** - * FieldOptions .google.api.fieldInfo. - * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference * @memberof google.protobuf.FieldOptions * @instance */ - FieldOptions.prototype[".google.api.fieldInfo"] = null; + FieldOptions.prototype[".google.api.resourceReference"] = null; /** * Creates a new FieldOptions instance using the specified properties. @@ -88354,14 +93894,14 @@ 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; } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -88504,16 +94044,16 @@ 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; } + 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; + } return null; }; @@ -88728,16 +94268,16 @@ 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"]); } + 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"]); + } return message; }; diff --git a/packages/google-cloud-alloydb/protos/protos.json b/packages/google-cloud-alloydb/protos/protos.json index ac730b97a32..37d3eebe023 100644 --- a/packages/google-cloud-alloydb/protos/protos.json +++ b/packages/google-cloud-alloydb/protos/protos.json @@ -1,4 +1,7 @@ { + "options": { + "syntax": "proto3" + }, "nested": { "google": { "nested": { @@ -19,6 +22,71 @@ "(google.api.resource_definition).pattern": "projects/{project}/global/networks/{network}" }, "nested": { + "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 + } + } + } + }, "InstanceView": { "values": { "INSTANCE_VIEW_UNSPECIFIED": 0, @@ -42,7 +110,16 @@ "values": { "DATABASE_VERSION_UNSPECIFIED": 0, "POSTGRES_13": 1, - "POSTGRES_14": 2 + "POSTGRES_14": 2, + "POSTGRES_15": 3, + "POSTGRES_16": 4 + } + }, + "SubscriptionType": { + "values": { + "SUBSCRIPTION_TYPE_UNSPECIFIED": 0, + "STANDARD": 1, + "TRIAL": 2 } }, "UserPassword": { @@ -363,10 +440,46 @@ } } }, + "MaintenanceUpdatePolicy": { + "fields": { + "maintenanceWindows": { + "rule": "repeated", + "type": "MaintenanceWindow", + "id": 1 + } + }, + "nested": { + "MaintenanceWindow": { + "fields": { + "day": { + "type": "google.type.DayOfWeek", + "id": 1 + }, + "startTime": { + "type": "google.type.TimeOfDay", + "id": 2 + } + } + } + } + }, + "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": { @@ -545,6 +658,56 @@ "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" + } } }, "nested": { @@ -554,7 +717,7 @@ "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED", + "(google.api.field_behavior)": "OPTIONAL", "(google.api.resource_reference).type": "compute.googleapis.com/Network" } }, @@ -587,6 +750,37 @@ } } }, + "PscConfig": { + "fields": { + "pscEnabled": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "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 + } + } + }, "State": { "values": { "STATE_UNSPECIFIED": 0, @@ -614,6 +808,8 @@ "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": { @@ -722,6 +918,14 @@ "(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, @@ -744,6 +948,36 @@ "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" + } } }, "nested": { @@ -847,6 +1081,71 @@ } } }, + "PscInstanceConfig": { + "fields": { + "serviceAttachmentLink": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "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" + } + } + } + }, + "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" + } + } + }, + "nested": { + "AuthorizedNetwork": { + "fields": { + "cidrRange": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_info).format": "IPV4" + } + } + } + } + } + }, "State": { "values": { "STATE_UNSPECIFIED": 0, @@ -880,7 +1179,9 @@ "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).pattern": "projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}/connectionInfo", + "(google.api.resource).plural": "connectionInfos", + "(google.api.resource).singular": "connectionInfo" }, "fields": { "name": { @@ -894,6 +1195,14 @@ "(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, @@ -907,6 +1216,8 @@ "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": { @@ -1035,12 +1346,27 @@ "(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": { @@ -1084,7 +1410,9 @@ "SupportedDatabaseFlag": { "options": { "(google.api.resource).type": "alloydb.googleapis.com/SupportedDatabaseFlag", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/flags/{flag}" + "(google.api.resource).pattern": "projects/{project}/locations/{location}/flags/{flag}", + "(google.api.resource).plural": "supportedDatabaseFlags", + "(google.api.resource).singular": "supportedDatabaseFlag" }, "oneofs": { "restrictions": { @@ -1166,6 +1494,8 @@ "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": { @@ -1197,6 +1527,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "keepExtraRoles": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } } }, "nested": { @@ -1209,6 +1546,38 @@ } } }, + "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" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "charset": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "collation": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, "AlloyDBAdmin": { "options": { "(google.api.default_host)": "alloydb.googleapis.com", @@ -1361,6 +1730,34 @@ } ] }, + "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", @@ -1667,6 +2064,26 @@ } ] }, + "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", @@ -1934,6 +2351,24 @@ "(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" + } + ] } } }, @@ -2170,6 +2605,32 @@ } } }, + "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": { @@ -2666,6 +3127,104 @@ "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" + } + } + } + }, + "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 + } } } }, @@ -3191,6 +3750,52 @@ } } } + }, + "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 + } + } } } }, @@ -10270,9 +10875,9 @@ }, "api": { "options": { - "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "go_package": "google.golang.org/genproto/googleapis/api;api", "java_multiple_files": true, - "java_outer_classname": "FieldInfoProto", + "java_outer_classname": "LaunchStageProto", "java_package": "com.google.api", "objc_class_prefix": "GAPI", "cc_enable_arenas": true @@ -10297,6 +10902,30 @@ "IDENTIFIER": 8 } }, + "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 + } + } + } + }, "resourceReference": { "type": "google.api.ResourceReference", "id": 1055, @@ -10755,30 +11384,6 @@ "GA": 4, "DEPRECATED": 5 } - }, - "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 - } - } - } } } }, diff --git a/packages/google-cloud-alloydb/samples/README.md b/packages/google-cloud-alloydb/samples/README.md index e191588c413..2bc80f8ac1b 100644 --- a/packages/google-cloud-alloydb/samples/README.md +++ b/packages/google-cloud-alloydb/samples/README.md @@ -23,6 +23,7 @@ * [Alloy_d_b_admin.delete_cluster](#alloy_d_b_admin.delete_cluster) * [Alloy_d_b_admin.delete_instance](#alloy_d_b_admin.delete_instance) * [Alloy_d_b_admin.delete_user](#alloy_d_b_admin.delete_user) + * [Alloy_d_b_admin.execute_sql](#alloy_d_b_admin.execute_sql) * [Alloy_d_b_admin.failover_instance](#alloy_d_b_admin.failover_instance) * [Alloy_d_b_admin.generate_client_certificate](#alloy_d_b_admin.generate_client_certificate) * [Alloy_d_b_admin.get_backup](#alloy_d_b_admin.get_backup) @@ -33,12 +34,14 @@ * [Alloy_d_b_admin.inject_fault](#alloy_d_b_admin.inject_fault) * [Alloy_d_b_admin.list_backups](#alloy_d_b_admin.list_backups) * [Alloy_d_b_admin.list_clusters](#alloy_d_b_admin.list_clusters) + * [Alloy_d_b_admin.list_databases](#alloy_d_b_admin.list_databases) * [Alloy_d_b_admin.list_instances](#alloy_d_b_admin.list_instances) * [Alloy_d_b_admin.list_supported_database_flags](#alloy_d_b_admin.list_supported_database_flags) * [Alloy_d_b_admin.list_users](#alloy_d_b_admin.list_users) * [Alloy_d_b_admin.promote_cluster](#alloy_d_b_admin.promote_cluster) * [Alloy_d_b_admin.restart_instance](#alloy_d_b_admin.restart_instance) * [Alloy_d_b_admin.restore_cluster](#alloy_d_b_admin.restore_cluster) + * [Alloy_d_b_admin.switchover_cluster](#alloy_d_b_admin.switchover_cluster) * [Alloy_d_b_admin.update_backup](#alloy_d_b_admin.update_backup) * [Alloy_d_b_admin.update_cluster](#alloy_d_b_admin.update_cluster) * [Alloy_d_b_admin.update_instance](#alloy_d_b_admin.update_instance) @@ -311,6 +314,23 @@ __Usage:__ +### Alloy_d_b_admin.execute_sql + +View the [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). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.execute_sql.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.execute_sql.js` + + +----- + + + + ### Alloy_d_b_admin.failover_instance View the [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). @@ -481,6 +501,23 @@ __Usage:__ +### Alloy_d_b_admin.list_databases + +View the [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). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_databases.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_databases.js` + + +----- + + + + ### Alloy_d_b_admin.list_instances View the [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). @@ -583,6 +620,23 @@ __Usage:__ +### Alloy_d_b_admin.switchover_cluster + +View the [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). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.switchover_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.switchover_cluster.js` + + +----- + + + + ### Alloy_d_b_admin.update_backup View the [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). diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js index 6de71dd245f..f4a949af133 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js @@ -38,13 +38,13 @@ function main(parent, requests) { // 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_backup.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_backup.js index a86744431dc..55f5bf8f3d7 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_backup.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_backup.js @@ -42,13 +42,13 @@ function main(parent, backupId, backup) { // 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_cluster.js index 1258ebd866e..a476e312f50 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_cluster.js @@ -43,22 +43,22 @@ function main(parent, clusterId, 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. + * 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 diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_instance.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_instance.js index 8ffce629fa4..a933aa9f7a3 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_instance.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_instance.js @@ -43,22 +43,22 @@ function main(parent, instanceId, instance) { // 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. + * 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 diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js index 198d7237206..1163cebc496 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js @@ -43,22 +43,22 @@ function main(parent, clusterId, 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. + * 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 diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js index 842c89ac960..b0f338a53f6 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js @@ -43,22 +43,22 @@ function main(parent, instanceId, instance) { // 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. + * 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 diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_user.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_user.js index 8eac9998644..d94d20fcb14 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_user.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_user.js @@ -42,13 +42,13 @@ function main(parent, userId, user) { // 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_backup.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_backup.js index 6de7922d4b8..30f51c39f28 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_backup.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_backup.js @@ -35,13 +35,13 @@ function main(name) { // 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_cluster.js index 5433bafeb5c..9d937d84ba9 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_cluster.js @@ -35,13 +35,13 @@ function main(name) { // 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -54,8 +54,9 @@ function main(name) { */ // const etag = 'abc123' /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. + * 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 /** diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_instance.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_instance.js index 6eb9acd4bc1..811f1d0db5c 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_instance.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_instance.js @@ -35,13 +35,13 @@ function main(name) { // 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). @@ -54,8 +54,9 @@ function main(name) { */ // const etag = 'abc123' /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. + * 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 diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js index e4d77a4732d..fe6477101ce 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js @@ -35,13 +35,13 @@ function main(name) { // 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). diff --git a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.execute_sql.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.execute_sql.js similarity index 100% rename from owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.execute_sql.js rename to packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.execute_sql.js diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.failover_instance.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.failover_instance.js index 89033a82aee..bbfdd104ce8 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.failover_instance.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.failover_instance.js @@ -35,21 +35,22 @@ function main(name) { // 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. + * 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 diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js index 1c211faaf42..3735a0ddac1 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js @@ -35,13 +35,13 @@ function main(parent) { // 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_connection_info.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_connection_info.js index 03c7c124ebc..e56f7efbcaf 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_connection_info.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_connection_info.js @@ -35,13 +35,13 @@ function main(parent) { // 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js index 3e15f1000c1..78f96ef28e8 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js @@ -39,22 +39,22 @@ function main(faultType, name) { // 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the fault - * injection. + * 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 diff --git a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_databases.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_databases.js similarity index 100% rename from owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.list_databases.js rename to packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_databases.js diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js index 55324e974de..046405d4bae 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js @@ -35,9 +35,9 @@ function main(name) { // 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID @@ -54,8 +54,9 @@ function main(name) { */ // const etag = 'abc123' /** - * Optional. If set, performs request validation (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. + * 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 diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restart_instance.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restart_instance.js index f1fea004669..2f5362f1a15 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restart_instance.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restart_instance.js @@ -35,23 +35,29 @@ function main(name) { // 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the restart. + * 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; diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restore_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restore_cluster.js index 0dca70cf96f..d5afe06e848 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restore_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restore_cluster.js @@ -52,22 +52,22 @@ function main(parent, clusterId, 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the import - * request. + * 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 diff --git a/owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.switchover_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.switchover_cluster.js similarity index 100% rename from owl-bot-staging/google-cloud-alloydb/v1/samples/generated/v1/alloy_d_b_admin.switchover_cluster.js rename to packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.switchover_cluster.js diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_backup.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_backup.js index 62af278e5b5..ab87adf08c1 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_backup.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_backup.js @@ -42,13 +42,13 @@ function main(backup) { // 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_cluster.js index cc29a39f9ee..b46d35b2a42 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_cluster.js @@ -42,22 +42,22 @@ function main(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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. + * 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 /** diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_instance.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_instance.js index 1e121d21ca5..c1d663630f5 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_instance.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_instance.js @@ -42,22 +42,22 @@ function main(instance) { // 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. + * 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 /** diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_user.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_user.js index 29a7e86e424..7ffa0bed716 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_user.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_user.js @@ -42,13 +42,13 @@ function main(user) { // 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). diff --git a/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json b/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json index 0a7512f59e9..7136df30a22 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json +++ b/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json @@ -234,7 +234,7 @@ "segments": [ { "start": 25, - "end": 84, + "end": 85, "type": "FULL" } ], @@ -290,7 +290,7 @@ "segments": [ { "start": 25, - "end": 80, + "end": 81, "type": "FULL" } ], @@ -331,6 +331,54 @@ } } }, + { + "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", @@ -778,7 +826,7 @@ "segments": [ { "start": 25, - "end": 80, + "end": 81, "type": "FULL" } ], @@ -830,7 +878,7 @@ "segments": [ { "start": 25, - "end": 74, + "end": 75, "type": "FULL" } ], @@ -930,7 +978,7 @@ "segments": [ { "start": 25, - "end": 74, + "end": 80, "type": "FULL" } ], @@ -950,6 +998,10 @@ { "name": "validate_only", "type": "TYPE_BOOL" + }, + { + "name": "node_ids", + "type": "TYPE_STRING[]" } ], "resultType": ".google.longrunning.Operation", @@ -967,6 +1019,62 @@ } } }, + { + "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": 78, + "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" + } + ], + "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", @@ -1630,6 +1738,58 @@ } } } + }, + { + "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" + } + } + } } ] } \ No newline at end of file diff --git a/packages/google-cloud-alloydb/src/v1/alloy_d_b_admin_client.ts b/packages/google-cloud-alloydb/src/v1/alloy_d_b_admin_client.ts index 9bfb9c3417c..efe05aad51a 100644 --- a/packages/google-cloud-alloydb/src/v1/alloy_d_b_admin_client.ts +++ b/packages/google-cloud-alloydb/src/v1/alloy_d_b_admin_client.ts @@ -223,6 +223,9 @@ export class AlloyDBAdminClient { 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}' ), @@ -269,6 +272,11 @@ export class AlloyDBAdminClient { 'nextPageToken', 'users' ), + listDatabases: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'databases' + ), }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); @@ -336,6 +344,12 @@ export class AlloyDBAdminClient { 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; @@ -436,6 +450,11 @@ export class AlloyDBAdminClient { 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), @@ -567,6 +586,7 @@ export class AlloyDBAdminClient { 'updateCluster', 'deleteCluster', 'promoteCluster', + 'switchoverCluster', 'restoreCluster', 'createSecondaryCluster', 'listInstances', @@ -579,6 +599,7 @@ export class AlloyDBAdminClient { 'failoverInstance', 'injectFault', 'restartInstance', + 'executeSql', 'listBackups', 'getBackup', 'createBackup', @@ -592,6 +613,7 @@ export class AlloyDBAdminClient { 'createUser', 'updateUser', 'deleteUser', + 'listDatabases', ]; for (const methodName of alloyDBAdminStubMethods) { const callPromise = this.alloyDBAdminStub.then( @@ -880,6 +902,102 @@ export class AlloyDBAdminClient { this.initialize(); return this.innerApiCalls.getInstance(request, options, callback); } + /** + * 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 {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(); + return this.innerApiCalls.executeSql(request, options, callback); + } /** * Gets details of a single Backup. * @@ -976,14 +1094,14 @@ export class AlloyDBAdminClient { * * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * * The request ID must be a valid UUID with the exception that zero UUID is @@ -1103,14 +1221,14 @@ export class AlloyDBAdminClient { * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * * The request ID must be a valid UUID with the exception that zero UUID is @@ -1294,14 +1412,14 @@ export class AlloyDBAdminClient { * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * * The request ID must be a valid UUID with the exception that zero UUID is @@ -1399,14 +1517,14 @@ export class AlloyDBAdminClient { * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * * The request ID must be a valid UUID with the exception that zero UUID is @@ -1501,14 +1619,14 @@ export class AlloyDBAdminClient { * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * * The request ID must be a valid UUID with the exception that zero UUID is @@ -1606,22 +1724,22 @@ export class AlloyDBAdminClient { * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. + * 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. @@ -1766,22 +1884,22 @@ export class AlloyDBAdminClient { * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. + * 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. @@ -1924,14 +2042,14 @@ export class AlloyDBAdminClient { * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * * The request ID must be a valid UUID with the exception that zero UUID is @@ -1941,8 +2059,9 @@ export class AlloyDBAdminClient { * 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. + * 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] @@ -2087,9 +2206,9 @@ export class AlloyDBAdminClient { * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request @@ -2104,8 +2223,9 @@ export class AlloyDBAdminClient { * 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. + * 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. @@ -2235,6 +2355,163 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1.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. + * + * @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.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + switchoverCluster( + request: protos.google.cloud.alloydb.v1.ISwitchoverClusterRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + switchoverCluster( + request: protos.google.cloud.alloydb.v1.ISwitchoverClusterRequest, + callback: Callback< + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + switchoverCluster( + request?: protos.google.cloud.alloydb.v1.ISwitchoverClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + 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(); + return this.innerApiCalls.switchoverCluster(request, options, callback); + } + /** + * 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< + LROperation< + protos.google.cloud.alloydb.v1.Cluster, + protos.google.cloud.alloydb.v1.OperationMetadata + > + > { + 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< + protos.google.cloud.alloydb.v1.Cluster, + protos.google.cloud.alloydb.v1.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 @@ -2256,22 +2533,22 @@ export class AlloyDBAdminClient { * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the import - * request. + * 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. @@ -2416,22 +2693,22 @@ export class AlloyDBAdminClient { * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. + * 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. @@ -2579,22 +2856,22 @@ export class AlloyDBAdminClient { * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. + * 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. @@ -2738,22 +3015,22 @@ export class AlloyDBAdminClient { * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the create - * request. + * 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. @@ -2907,14 +3184,14 @@ export class AlloyDBAdminClient { * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * * The request ID must be a valid UUID with the exception that zero UUID is @@ -3063,22 +3340,22 @@ export class AlloyDBAdminClient { * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the update - * request. + * 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. @@ -3221,14 +3498,14 @@ export class AlloyDBAdminClient { * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * * The request ID must be a valid UUID with the exception that zero UUID is @@ -3238,8 +3515,9 @@ export class AlloyDBAdminClient { * 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the delete. + * 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. @@ -3381,21 +3659,22 @@ export class AlloyDBAdminClient { * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the failover. + * 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. @@ -3538,22 +3817,22 @@ export class AlloyDBAdminClient { * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the fault - * injection. + * 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. @@ -3694,21 +3973,25 @@ export class AlloyDBAdminClient { * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate 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 (e.g. permission checks and - * any other type of validation), but do not actually execute the restart. + * 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. @@ -3851,14 +4134,14 @@ export class AlloyDBAdminClient { * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * * The request ID must be a valid UUID with the exception that zero UUID is @@ -4010,14 +4293,14 @@ export class AlloyDBAdminClient { * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * * The request ID must be a valid UUID with the exception that zero UUID is @@ -4167,14 +4450,14 @@ export class AlloyDBAdminClient { * 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 will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. + * request ID so that if you must retry your request, the server ignores the + * request if it has already been completed. The server guarantees that for at + * least 60 minutes since the first request. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents + * ID, the server can check if the original operation with the same request ID + * was received, and if so, ignores the second request. This prevents * clients from accidentally creating duplicate commitments. * * The request ID must be a valid UUID with the exception that zero UUID is @@ -5328,6 +5611,210 @@ export class AlloyDBAdminClient { 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(); + return this.innerApiCalls.listDatabases(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, 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(); + 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(); + 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. @@ -5896,6 +6383,73 @@ export class AlloyDBAdminClient { ).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. * diff --git a/packages/google-cloud-alloydb/src/v1/alloy_d_b_admin_client_config.json b/packages/google-cloud-alloydb/src/v1/alloy_d_b_admin_client_config.json index 31390b71df1..a802cb3de79 100644 --- a/packages/google-cloud-alloydb/src/v1/alloy_d_b_admin_client_config.json +++ b/packages/google-cloud-alloydb/src/v1/alloy_d_b_admin_client_config.json @@ -62,6 +62,11 @@ "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", @@ -122,6 +127,11 @@ "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", @@ -186,6 +196,11 @@ "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/packages/google-cloud-alloydb/src/v1/alloy_d_b_admin_proto_list.json b/packages/google-cloud-alloydb/src/v1/alloy_d_b_admin_proto_list.json index 4d0365b4487..b5e2e53d68c 100644 --- a/packages/google-cloud-alloydb/src/v1/alloy_d_b_admin_proto_list.json +++ b/packages/google-cloud-alloydb/src/v1/alloy_d_b_admin_proto_list.json @@ -1,4 +1,5 @@ [ + "../../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/packages/google-cloud-alloydb/src/v1/gapic_metadata.json b/packages/google-cloud-alloydb/src/v1/gapic_metadata.json index 68a425c087a..137fb3217d6 100644 --- a/packages/google-cloud-alloydb/src/v1/gapic_metadata.json +++ b/packages/google-cloud-alloydb/src/v1/gapic_metadata.json @@ -20,6 +20,11 @@ "getInstance" ] }, + "ExecuteSql": { + "methods": [ + "executeSql" + ] + }, "GetBackup": { "methods": [ "getBackup" @@ -75,6 +80,11 @@ "promoteCluster" ] }, + "SwitchoverCluster": { + "methods": [ + "switchoverCluster" + ] + }, "RestoreCluster": { "methods": [ "restoreCluster" @@ -174,6 +184,13 @@ "listUsersStream", "listUsersAsync" ] + }, + "ListDatabases": { + "methods": [ + "listDatabases", + "listDatabasesStream", + "listDatabasesAsync" + ] } } }, @@ -190,6 +207,11 @@ "getInstance" ] }, + "ExecuteSql": { + "methods": [ + "executeSql" + ] + }, "GetBackup": { "methods": [ "getBackup" @@ -245,6 +267,11 @@ "promoteCluster" ] }, + "SwitchoverCluster": { + "methods": [ + "switchoverCluster" + ] + }, "RestoreCluster": { "methods": [ "restoreCluster" @@ -344,6 +371,13 @@ "listUsersStream", "listUsersAsync" ] + }, + "ListDatabases": { + "methods": [ + "listDatabases", + "listDatabasesStream", + "listDatabasesAsync" + ] } } } diff --git a/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1.ts b/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1.ts index e31d247cd6e..b3cc00e6315 100644 --- a/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1.ts +++ b/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1.ts @@ -603,6 +603,136 @@ describe('v1.AlloyDBAdminClient', () => { }); }); + describe('executeSql', () => { + it('invokes executeSql without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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', + }); + 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', + }); + 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', + }); + 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(); + await assert.rejects(client.executeSql(request), expectedError); + }); + }); + describe('getBackup', () => { it('invokes getBackup without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ @@ -2298,6 +2428,200 @@ describe('v1.AlloyDBAdminClient', () => { }); }); + describe('switchoverCluster', () => { + it('invokes switchoverCluster without error', async () => { + const client = new alloydbadminModule.v1.AlloyDBAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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', + }); + 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< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >; + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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({ @@ -6370,17 +6694,318 @@ describe('v1.AlloyDBAdminClient', () => { ); }); }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { + + describe('listDatabases', () => { + it('invokes listDatabases without error', async () => { const client = new alloydbadminModule.v1.AlloyDBAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() + new protos.google.cloud.alloydb.v1.ListDatabasesRequest() ); - request.resource = ''; + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + 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', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; const expectedHeaderRequestParams = 'resource='; const expectedOptions = { otherArgs: { @@ -7403,6 +8028,82 @@ describe('v1.AlloyDBAdminClient', () => { }); }); + describe('database', () => { + 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', + }); + 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', () => { const fakePath = '/rendered/path/instance'; const expectedParameters = {